View Single Post
Old 09-19-2006, 09:18 AM   #1 (permalink)
piskie
Junior Member
 
Join Date: Sep 2006
Posts: 3
Default Query ALL Tables in a Database

***EDITED BY O~Snapple PLEASE USE TAGS WHEN POSTING CODE***
I have a site that stores each individual merchants' products in his own Table within a single database for the whole site.

What I need to achieve is a site search that will query ALL Tables within the one Database. The tables are identical in structure.

The Tables are sequentialy named from T101 upwards.
Curent Queries similar to:
PHP Code:
$query_LISTALL "SELECT * FROM T111 ORDER BY auto ASC"

I need (or would very much like) the query to be unaffected by addition and/or deletion of Tables as Merchants come and go.

There would be no problem leaving a Table intact but empty instead of deleting.

I envisaged some sort of wild card/s within the query or a from/to expression, but I don't know whether MYSQL will handle that in the context of Tables. Nice if it can.

Please keep any reply in simple terms as this is my first database driven site.

Last edited by piskie : 09-19-2006 at 12:21 PM.
piskie is offline   Reply With Quote
Sponsored Links