From e0bb4e05d30e880941f4299755d8f234f5a09894 Mon Sep 17 00:00:00 2001 From: Eliot Whalan Date: Mon, 16 Nov 2015 13:55:10 +1000 Subject: Change SQL query from name to filename to resolve duplicate entries in the database --- static/upload.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'static/upload.php') diff --git a/static/upload.php b/static/upload.php index 655dd9c..edae4f8 100644 --- a/static/upload.php +++ b/static/upload.php @@ -80,8 +80,8 @@ function generate_name($file) } // Check if a file with the same name does already exist in the database - $q = $db->prepare('SELECT COUNT(name) FROM pomf WHERE name = (:name)'); - $q->bindValue(':name', $name, PDO::PARAM_STR); + $q = $db->prepare('SELECT COUNT(filename) FROM pomf WHERE filename = (:filename)'); + $q->bindValue(':filename', $name, PDO::PARAM_STR); $q->execute(); $result = $q->fetchColumn(); // If it does, generate a new name -- cgit v1.2.3