fixed error in check for exiting tables

Signed-off-by: tracer <tracer@24unix.net>
This commit is contained in:
tracer 2022-01-23 19:19:05 +01:00
parent b3e0067ce1
commit 2c6179914a
1 changed files with 3 additions and 1 deletions

View File

@ -30,7 +30,9 @@ class DatabaseConnection
);
$sql = "SHOW TABLES";
$statement = $this->dbConnection->prepare($sql);
if (!$statement->execute()) {
$statement->execute();
$result = $statement->fetch();
if (empty($result)) {
echo 'Error: Cannot find tables.' . PHP_EOL;
if (confirm('Should I try to create them?')) {