Problems with "show tables from $dbname" query
Posted: Sun Feb 18, 2007 2:05 pm
Hi,
I'm trying to return a list of all tables from my database by using the "show tables from <dbname>" query, and fetching the returned rows from the result handle.
However, although the first table is correctly returned, that's it, it doesn't return any of the others.
I'm read in some places that this particular query will only return tables with data in them, however more of the tables in my database have rows in them, and these are not being returned. I don't know if this query returns the tables in alphabetical order, however the table returned by the query is the first table alphabetically.
Bizarrely, if I check the number of rows returned using mysql_num_rows, it returns the correct number of tables in the selected database, however the row fetch returns false after only the first table.
I've spent a while trying to work this out, but it sort of eludes me, as if its going on at a lower level that you don't have access to in PHP.
Any ideas please.
Many thanks
I'm trying to return a list of all tables from my database by using the "show tables from <dbname>" query, and fetching the returned rows from the result handle.
However, although the first table is correctly returned, that's it, it doesn't return any of the others.
I'm read in some places that this particular query will only return tables with data in them, however more of the tables in my database have rows in them, and these are not being returned. I don't know if this query returns the tables in alphabetical order, however the table returned by the query is the first table alphabetically.
Bizarrely, if I check the number of rows returned using mysql_num_rows, it returns the correct number of tables in the selected database, however the row fetch returns false after only the first table.
I've spent a while trying to work this out, but it sort of eludes me, as if its going on at a lower level that you don't have access to in PHP.
Any ideas please.
Many thanks