Jump to content


Photo

php mysql select from database


  • Please log in to reply
3 replies to this topic

#1 jbille

jbille
  • Members
  • PipPip
  • Member
  • 13 posts

Posted 12 October 2006 - 02:16 AM

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.

#2 trq

trq
  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 12 October 2006 - 02:19 AM

The question is why? Your database design sounds like it is foobar if this really is the solution you seek.

#3 jbille

jbille
  • Members
  • PipPip
  • Member
  • 13 posts

Posted 12 October 2006 - 02:55 AM

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

#4 btherl

btherl
  • Staff Alumni
  • Advanced Member
  • 3,893 posts
  • LocationAustralia

Posted 12 October 2006 - 06:28 AM

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?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users