Whoops amature mistake 😉
Have echod and semi coloned, but still no sucsess, something to do with the
foreach($rows as $row)
part. Says its unexpected? I say it should expect what it ever you give it but PHP says differently 😕
I have had a play around by taking it out, messing around with the { }s but no luck.
<?php
for($i = 0; $i < $num; ++$i)
{
$row = mysql_fetch_assoc($result);
$tables[$row['Cat']][] = $row;
}
ksort($tables); // put the cats into a consistent order
foreach($tables as $cat => $rows)
{
'<table width="900" border="0">'// Start table for Cat $cat (1, 2 or 3)
foreach($rows as $row)
{
'<tr>
<td><div align="center"><a href="product.php?id='. echo $row['ProductID']; .'"><img src="'. echo $row['Image1']; .'" width="160" height="120" /></a></div></td>
<td><a href="product.php?id='. echo $row['ProductID']; .'">'. echo $row['Product']; .'</a></td>
<td>'. echo $row['Price']; .'</td>
</tr>'
}
'</table>'
}
?>