Hi guys,
I need help on a clean way to check if a table exists.
I want to set a variable based on if the table exists or not or if it does and it’s empty set $dbnum to 0
My Current Query is :
$dbnumbers = $db->prepare('SELECT * FROM '.$tablename.'');
$dbnumbers->execute();
$count = $dbnumbers->rowCount();
if ($count == 0) {
$dbnum = "0";
} else {
$dbnum = $count;
}