shotazi
Oct 28th 2007, 12:56 pm
I select results from database with limit 15 then i want to isernt them in three rows
but i can't i am making this code:
<table width="1%" align="center" cellpadding="0" cellspacing="0">
<tr>
<?php
$gamedt = mysql_query("SELECT * FROM `n-games` ORDER BY `count` LIMIT 15");
while($row = mysql_fetch_array($gamedt)){
$gameid = $row['gameid'];
$title = $row['title'];
$gameurl = $row['gameurl'];
$gamepic = $row['gamepic'];
$width = $row['width'];
$height = $row['height'];
$count = $row['count'];
$category = $row['category'];
?>
<td><center><? echo $title; ?></center> <a href="?page=play&file=<? echo $gameid; ?>"><img src="<? echo $gamepic; ?>" width="100" height="100" ></a></td>
<? } ?>
</tr>
</table>
in this example results are in one row and i want to insert them in three rows, in table like this
<table>
<tr>
<td>5 results</td>
</tr>
<tr>
<td>5 results</td>
</tr>
<tr>
<td>5 results</td>
</tr>
</table>
please help me :(
but i can't i am making this code:
<table width="1%" align="center" cellpadding="0" cellspacing="0">
<tr>
<?php
$gamedt = mysql_query("SELECT * FROM `n-games` ORDER BY `count` LIMIT 15");
while($row = mysql_fetch_array($gamedt)){
$gameid = $row['gameid'];
$title = $row['title'];
$gameurl = $row['gameurl'];
$gamepic = $row['gamepic'];
$width = $row['width'];
$height = $row['height'];
$count = $row['count'];
$category = $row['category'];
?>
<td><center><? echo $title; ?></center> <a href="?page=play&file=<? echo $gameid; ?>"><img src="<? echo $gamepic; ?>" width="100" height="100" ></a></td>
<? } ?>
</tr>
</table>
in this example results are in one row and i want to insert them in three rows, in table like this
<table>
<tr>
<td>5 results</td>
</tr>
<tr>
<td>5 results</td>
</tr>
<tr>
<td>5 results</td>
</tr>
</table>
please help me :(