Reputation: 358
I am getting the list of tables that matches the query string from the database.
show tables like '%fit%'
Tables_in_pdi (%fit%)
fit_types
In PHP while i am fetching these , i am getting the output as
Array ( [Tables_in_pdi (%fit%)] => fit_types )
If there is an anyway to give alias for these , so that it will be easy for me to take the data in php
Upvotes: 1
Views: 139
Reputation:
it would be easier to use the INFORMATION_SCHEMA database:
http://dev.mysql.com/doc/refman/5.0/en/tables-table.html
SELECT table_name FROM INFORMATION_SCHEMA.TABLES
WHERE table_schema = 'DB_NAME'
AND table_name LIKE '%fit%'
Upvotes: 2