jjk2 Posted April 8, 2009 Share Posted April 8, 2009 how do i search multiple fields from uniform but multiple number of tables in a database? so a database called School contains 300 tables for each school. how can i do search multiple fields across all 300 tables ? Quote Link to comment https://forums.phpfreaks.com/topic/153085-how-to-search-multiple-fields-of-all-tables-in-a-database/ Share on other sites More sharing options...
Yesideez Posted April 8, 2009 Share Posted April 8, 2009 You will be typing one veeeeeeeerrrrrrrrrrrrrryyyyyyyyyy long query. Quote Link to comment https://forums.phpfreaks.com/topic/153085-how-to-search-multiple-fields-of-all-tables-in-a-database/#findComment-804284 Share on other sites More sharing options...
jjk2 Posted April 12, 2009 Author Share Posted April 12, 2009 should i look into JOINS Quote Link to comment https://forums.phpfreaks.com/topic/153085-how-to-search-multiple-fields-of-all-tables-in-a-database/#findComment-808164 Share on other sites More sharing options...
mandred Posted April 13, 2009 Share Posted April 13, 2009 Uhm..."SELECT * FROM table WHERE field='value' OR otherfield='value' OR anotherfield='value'"? Quote Link to comment https://forums.phpfreaks.com/topic/153085-how-to-search-multiple-fields-of-all-tables-in-a-database/#findComment-808454 Share on other sites More sharing options...
Neomech Posted April 26, 2009 Share Posted April 26, 2009 You won't get an easy answer because you are designing your database in the wrong way (sorry, don't know a nicer way to put that). If you have 300 different schools, you should be using ONE table for all of your data about the schools. You differentiate between the different schools within that one table by having a column called "SchoolID" or something like that. I'm not sure if that's enough information to get you sorted out, but you definitely do NOT want to have 300 different tables because there are 300 different schools. You're missing a key element of database design there. Good luck! Quote Link to comment https://forums.phpfreaks.com/topic/153085-how-to-search-multiple-fields-of-all-tables-in-a-database/#findComment-819668 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.