Prevent fetching many rows to check table existance

This commit is contained in:
Mathieu Leplatre 2014-01-26 20:40:20 +01:00
parent ee9210151e
commit c15e63d204

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