jbille Posted October 12, 2006 Share Posted October 12, 2006 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. Link to comment https://forums.phpfreaks.com/topic/23720-php-mysql-select-from-database/ Share on other sites More sharing options...
trq Posted October 12, 2006 Share Posted October 12, 2006 The question is why? Your database design sounds like it is foobar if this really is the solution you seek. Link to comment https://forums.phpfreaks.com/topic/23720-php-mysql-select-from-database/#findComment-107729 Share on other sites More sharing options...
jbille Posted October 12, 2006 Author Share Posted October 12, 2006 I would use sub-tables, however I would need to have 5 columns in every sub-table. Do you have any other suggestions. Link to comment https://forums.phpfreaks.com/topic/23720-php-mysql-select-from-database/#findComment-107738 Share on other sites More sharing options...
btherl Posted October 12, 2006 Share Posted October 12, 2006 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? Link to comment https://forums.phpfreaks.com/topic/23720-php-mysql-select-from-database/#findComment-107784 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.