Skip to content

Commit

Permalink
Update Berlindb query :closes: #6986
Browse files Browse the repository at this point in the history
  • Loading branch information
Khadreal committed Oct 3, 2024
1 parent 2535926 commit e943fa1
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions inc/Dependencies/Database/Table.php
Original file line number Diff line number Diff line change
Expand Up @@ -358,10 +358,9 @@ public function exists() {
return false;
}

// Query statement
$query = "SHOW TABLES LIKE %s";
$like = $db->esc_like( $this->table_name );
$prepared = $db->prepare( $query, $like );
// Query statement to check if table exists.
$query = "SELECT table_name FROM information_schema.TABLES WHERE table_name = %s LIMIT 1";
$prepared = $db->prepare( $query, $this->table_name );
$result = $db->get_var( $prepared );

// Does the table exist?
Expand Down

0 comments on commit e943fa1

Please # to comment.