Does anyone happen to know why this query when executed in phpMyAdmin gives me all the data I need.
But when executed programmatically in PHP, it returns 0 rows.
Thanks!
SELECT `table_schema`, `table_name`
FROM `information_schema`.`TABLES`
WHERE `Engine`='MyISAM'
AND `TABLE_SCHEMA` !='information_schema'
AND `TABLE_SCHEMA` !='mysql';
Update:
Here is the asked for PHP code.
$query = "SELECT `table_schema`, `table_name`
FROM `information_schema`.`TABLES`
WHERE `Engine`='MyISAM' AND `TABLE_SCHEMA` !='information_schema' AND `TABLE_SCHEMA` !='mysql'";
$result = mysql_query($query);
echo '--:'.mysql_num_rows($result).':--';
while ($row = mysql_fetch_array($result)) {
print_r($row);
}
And yes I’m using double quotes…
Serhiy,
I have also tried this sort of thing, and what I noticed is that phpmyadmin query strings are not exactly compatible with PHP query strings. phpmyadmin, tends to add a few extra characters to its query strings.
In your PHP query try something like:
Good luck!
H