Jump to content

Archived

This topic is now archived and is closed to further replies.

jbille

php mysql select from database

Recommended Posts

I'm not sure if this is the correct forum to ask this but I'm going to anyway.  I have a php program which needs to select * from every table where number = '$number' in the entire database and return what table it matches the $number.  The only thing I can think of is a bunch of if statements.  If anyone could give me some advice about what to do I would greatly appreciate it.  Thanks.

Share this post


Link to post
Share on other sites
The question is why? Your database design sounds like it is foobar if this really is the solution you seek.

Share this post


Link to post
Share on other sites
I would use sub-tables, however I would need to have 5 columns in every sub-table.  Do you have any other suggestions.

Share this post


Link to post
Share on other sites
You could make an array of all the tables you want to check and use a for loop.. is that the kind of solution you're looking for?

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.