Hi guys…
I’m looking for help. I have written a query which works fine and pulls anything from 1 result to 100. What I would like to do is display these result in a grid formation not a list. The grid ideally would be 3 columns by 4 rows (12 results in all) an also a next button depending if there are further results….
So far I have got:
<table width="100%" border="0" cellspacing="10" cellpadding="0">
<tr>
<?php
$query = "SELECT * FROM artists LIMIT 3";
$result = mysql_query($query) or die ("Error in query: $query. " . mysql_error());
// if records present
if (mysql_num_rows($result) > 0) {
while($row = mysql_fetch_object($result)) { ?>
<td><?php echo $row->artist ?></td>
<?php
}
}
?>
</tr>
</table>
Can anyone help me out or direct me to a good tutorial…Thanks
Gareth