I am writing a classified ads system for my work, and it works great... except that my boss wants it to be laid out in tables like this :
[category] [other category]
item 1 item 2 item 1 item 2
item 3 item 3 item 4
You get the idea, right?
here's basically how i get the main categories and their sub categories : (keep in mind that it works like this - main categories have a parent id of -1, sub categories have a parent id matching the id of a main category)
$qry = "SELECT * FROM list_cat WHERE parent = -1";
$database->query($qry);
while($res = mysql_fetch_array($database->result)) {
//loop through and store each result into an array
//called $parents
}
foreach($parents as $par) {
//try to make tables here
}
But it is really f***d up. Check it out :
http://www.cashwon.com/classifieds/
I am looking for suggestions on how to generate the tables to display one on the left, one on the right, each table having two columns (except for the header of course... but that's just a colspan)