View Single Post
Old 02-17-2013, 09:27 PM   PM User | #3
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,168
Thanks: 59
Thanked 3,992 Times in 3,961 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
But now the problem is that you have a very bad database design.

There is NO REASON to have one database table per "folder" (whatever a folder means to you) and many, many reasons to only have a single table for *ALL* folders.

So if what you are talking about is that one of your "folders" corresponds to "asus/pegatron", then you should put *ALL* your "folders" into one table and add a column named "folder".

And then you would do, instead of what you show:
Code:
$query = "SELECT * FROM allBoards WHERE folder = 'asus/pegatron' ORDER BY codename ASC";
Or, probably much better for your purposes:
Code:
$query = "SELECT * FROM allBoards WHERE folder = '$foldername' ORDER BY codename ASC";
And now you can use one PHP page to show info for any "folder".

Don't start from a bad database design and then hope to compensate for it in your PHP code. Get the DB design right first and then the PHP will be simpler.
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Old Pedant is offline   Reply With Quote
Users who have thanked Old Pedant for this post:
Ctechinfo (02-17-2013)