ok, now im confused...
where can I access and display the info from the 2 columns I am trying to access? Im trying the following but (obviously) to no avail. How do I access the values of id and thumbnail from the $row variable? This is what Im trying right now.
$query = "Select id, thumbnail from photo where category='" .$category. "'";
$result = mysql_query($query);
$numrows = mysql_num_rows($result);
$rowlength = 7;
$counter = 0;
echo '<table border="1" cellpadding="2"><tr>';
while($row = mysql_fetch_row($result))
{
echo "<td><a href='gallary/display.php?id=".$row[id]."'><img src='".$row[thumbnail]."' border='0' hspace='5'></a></td>";
if(++$counter % $rowlength == 0)
{
echo '</tr><tr>';
}
}
// Need to add any 'extra' empty tds
if(($numextra = $rowlength - ($numrows % $rowlength)) !== 0){
echo str_repeat('<td> </td>', $numextra);
}
echo '</tr></table>';