This uses a nested tables approach:
PHP Code:
<?php
$query = "SELECT shoe.shoename, appetizers.price, shoe.moreinfo
FROM shoe
INNER
JOIN shoe_kind
ON shoe.kind_id=shoe_kind.kind_id";
$result = mysql_query($query, $connection);
// initialize the counter
$count = 1;
//get the container table started
echo "<table border=\"1\"><tr>";
while ($row = mysql_fetch_array($result)) {
// create a table with four rows and one column that represents one <td></td> in the container table
echo "<td><table border=\"1\"><tr>
<td>" . $row['shoename'] . "</td>
</tr>
<tr>
<td><img src=\"../images/shoesname.jpg\" alt=\"sd\" width=\"97\" height=\"80\" border=\"1\" style=\"border-color:#FF6600;\" /> </td>
</tr>
<tr>
<td>" . $row['price'] . "</td>
</tr>
<tr>
<td>" . $row['moreinfo'] . "</td>
</tr></table>
</td>";
// if there are four in a row, start a new row
if ($count == 4) {
echo "</tr><tr>";
}
$count++;
//reset the counter after four
if ($count == 5)
$count = 1;
}
// finish off the containter table
echo "</tr></table>";
?>
Bookmarks