From c15e63d20443db877f21519c9373ab11546b4bb8 Mon Sep 17 00:00:00 2001 From: Mathieu Leplatre Date: Sun, 26 Jan 2014 20:40:20 +0100 Subject: [PATCH] Prevent fetching many rows to check table existance --- php/modules/db.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/php/modules/db.php b/php/modules/db.php index 385b917..439ecf3 100755 --- a/php/modules/db.php +++ b/php/modules/db.php @@ -22,7 +22,7 @@ function dbConnect() { if (!$database->select_db($dbName)) if (!createDatabase($dbName, $database)) exit('Error: Could not create database!'); - if (!$database->query("SELECT * FROM lychee_photos, lychee_albums, lychee_settings;")) + if (!$database->query("SELECT * FROM lychee_photos, lychee_albums, lychee_settings LIMIT 1;")) if (!createTables($database)) exit('Error: Could not create tables!'); // Avoid sql injection on older MySQL versions @@ -183,4 +183,4 @@ function createTables($database) { } -?> \ No newline at end of file +?>