|
Posted by Tom on 02/02/05 17:20
Graham Cossey wrote:
>You don't say how many tables you have, how they are named or anything
>outside of the query itself.
>
>Assuming that not all your tables are named PID_* how about simply doing
>
>SHOW TABLES LIKE '%PID_%'
>
>and selecting appropriate results within the php script using strstr
>or regular expressions? SHOW TABLES is (normally) such a quick query
>returning a larger result set shouldn't be too much of a problem,
>should it?
>
>
>
If it is, then you should rework your db to reduce the number of tables :)
Alternatively use multi-query with use_result and more_results.
If it's concise code that you are after, then set up all the search
strings in an array, and pass this through a loop that performs each
query at a time and cats the results into a new array.
>HTH
>
>Graham
>
>On Wed, 02 Feb 2005 15:15:38 +0100, Marek Kilimajer <lists@kilimajer.net> wrote:
>
>
>>Shaun wrote:
>>
>>
>>>Hi guys,
>>>
>>>Thanks for your replies but neither UNION or REGEXP can be used with SHOW
>>>TABLES...
>>>
>>>Any ideas?
>>>
>>>
>>It's time to change your table design. Use one pid table and add another
>>column that would hold the number.
>>
>>--
>>PHP General Mailing List (http://www.php.net/)
>>To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>>
>>
>
>
>
>
Navigation:
[Reply to this message]
|