Merge pull request #57 from leplatrem/patch-1

Prevent fetching many rows to check table existance (fixes #54 and #50)
This commit is contained in:
Tobias Reich 2014-01-26 14:14:39 -08:00
commit f0f50fae3c

View File

@ -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) {
}
?>
?>