summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEliot Whalan <ewhal@pantsu.cat>2015-11-16 04:55:10 +0100
committerEliot Whalan <ewhal@pantsu.cat>2015-11-16 04:55:10 +0100
commite0bb4e05d30e880941f4299755d8f234f5a09894 (patch)
tree52bdc438b90a34b6074e6654b8e6158b13a8dbc1
parent904f76dc4923502456299ce2c5abc99b026665ce (diff)
Change SQL query from name to filename to resolve duplicate entries in the database
-rw-r--r--static/upload.php4
1 files changed, 2 insertions, 2 deletions
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