Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent fetching many rows to check table existance (fixes #54) #57

Merged
merged 1 commit into from
Jan 26, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions php/modules/db.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -183,4 +183,4 @@ function createTables($database) {

}

?>
?>