Prevent fetching many rows to check table existance
This commit is contained in:
parent
ee9210151e
commit
c15e63d204
@ -22,7 +22,7 @@ function dbConnect() {
|
|||||||
|
|
||||||
if (!$database->select_db($dbName))
|
if (!$database->select_db($dbName))
|
||||||
if (!createDatabase($dbName, $database)) exit('Error: Could not create database!');
|
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!');
|
if (!createTables($database)) exit('Error: Could not create tables!');
|
||||||
|
|
||||||
// Avoid sql injection on older MySQL versions
|
// Avoid sql injection on older MySQL versions
|
||||||
@ -183,4 +183,4 @@ function createTables($database) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
Loading…
Reference in New Issue
Block a user