Alex Rivera | Logout

matching tables name with show tables

Asked 2010-12-13T18:15:51.953
26

I'm trying to get all tables name from a database.

In my DB I have tables like:

_table1,
_table2,
table3,
table4,
table5_xrefs

but I want to get only the tables without _ at the beginning and without _xref at the end. So in this example I need only table3 and table4.

I'm using show tables to show all tables name and after I'm using PHP to match the correct table name. I was wondering if I could do the same using only a MySQL query.

Edit
Report

1 Answer

7

You can use LIKE or WHERE in SHOW TABLES queries.

answered 2010-12-13T18:26:06.210

Your Answer