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:
$query = "SELECT * FROM allBoards WHERE folder = 'asus/pegatron' ORDER BY codename ASC";
Or, probably much better for your purposes:
$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.