I'm using a CMS that installs some tables then to verify everything installed correctly attempts to count the number of tables in the database. (Note the goal is to count the tables themselves and not the rows in the tables)
The query that's used is "SHOW TABLES" the results of this is saved to "$result". Like so:
$link->query("SHOW TABLES")
Then farther down the code there's a count on $result like so:
if ($result->rowCount() > 0) {
$r = $result->fetchAll(PDO::FETCH_ASSOC);
}else{
$r = false;
return $r;
}
When I test the result I'm getting 0 returned. (There are 14 tables in the DB) Is rowCount the proper method to apply when using SHOW TABLES? From what I read rowCount only counts affected rows. Since SHOW TABLES doesn't affect anything it won't count anything.
Is my assumption correct or is there something else going on here?