okie dokie..try using a counter like in the following code: (I apologize for any php syntax errors that might happen..dont have php parser at my disposal right now, so no real way to test:
Code:
$sql = mysql_query("SELECT * FROM ava_games WHERE published=1 ORDER BY id desc LIMIT 6");
echo '<table>';
$cellCounter=0; //Initialize cell counter variable
while($row = mysql_fetch_array($sql))
{
$abcd= $row['name'];
$abcd = str_replace (" ", "-", $abcd);
if ($seo_on == 0)
{
$url = games.php?task=view&id='.$row['id'].'';
}
else
{
$url = 'view/'.$row['id'].'/'.$abcd.'.htm';
}
if($cellCounter==2)
{
echo '</tr>'; //Close the row
echo '<tr>'; //Open new row for next group of two cells
$cellCounter=0; //Re-set counter variable
}
if($cellCounter==0)
{
echo '<tr>'; //First row for data
}
echo '<td>'; //need to have data in table cells if you want a table
echo ' <a href="'.$site_url.'/'.$url.'"><img src="'.$row['image'].'" width="100" height="75" alt="'.$row['name'].'"></a>';
echo '</td>';
$cellCounter=$cellCounter+1;
}
echo '</table>';
Bookmarks