I'm trying to display the results of my query into a three columns for each row returned.
The setup is 3 divs all floating left inside one large wrapper. Easy enough, yeah?
#wrapper {width: 650px;}
#left {width: 200px; float: left;}
#middle {width: 200px; float: left;}
#right {width: 200px; float: left;}
Results displayed like:
LEFT | MIDDLE | RIGHT
LEFT | MIDDLE | RIGHT
LEFT | MIDDLE | RIGHT
LEFT | MIDDLE | RIGHT
Only now, I have this mysql associative query I want to display the results of in each column.
To be simple, I have Column A that needs to be in the left div.
Columns B through Y in middle div.
Column Z in right div.
Here's my query:
while ($row = mysql_fetch_assoc($result)) {
foreach ($row as $col => $val) {
if ($col == "Column A") {
//How to get this in left div?
}
if ($col != "Column A" && $col != "Column Z") {
//How to get this in middle div?
}
if ($col == "Column Z") {
//How to get this in right div?
}
}
}
I'm really not sure where to even start.