diff options
| author | Eliot Whalan <ewhal@pantsu.cat> | 2015-11-16 04:55:10 +0100 |
|---|---|---|
| committer | Eliot Whalan <ewhal@pantsu.cat> | 2015-11-16 04:55:10 +0100 |
| commit | e0bb4e05d30e880941f4299755d8f234f5a09894 (patch) | |
| tree | 52bdc438b90a34b6074e6654b8e6158b13a8dbc1 /static/upload.php | |
| parent | 904f76dc4923502456299ce2c5abc99b026665ce (diff) | |
Change SQL query from name to filename to resolve duplicate entries in the database
Diffstat (limited to 'static/upload.php')
| -rw-r--r-- | static/upload.php | 4 |
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 |
