como veran solo se muestran 3 juegos cuando hay un total de 6... haora lo q me pasa es q si muestro por ejemplo 3 se muestran horizontalmente... uno al lado del otro.. y yo preiso se alla 2 y despues otros 2 pero estos debajo...
codigo :
Código PHP :
<?php
define('HOST','localhost');
define('DB_NAME','web');
define('DB_USER','alex');
define('DB_PASS','lalala :P');
define('DB_TABLE','games');
$conect = mysql_connect(HOST,DB_USER,DB_PASS,DB_NAME) or die ("Error de conexion con la base de datos.");
$db = mysql_select_db(DB_NAME);
// maximo por pagina
$limit = 2;
// pagina pedida
$pag = (int) $_GET["pag"];
if ($pag < 1)
{
$pag = 1;
}
$offset = ($pag-1) * $limit;
$sql = "SELECT SQL_CALC_FOUND_ROWS id,descripcion, nombre FROM games LIMIT $offset, $limit";
$sqlTotal = "SELECT FOUND_ROWS() as total";
$rs = mysql_query($sql);
$rsTotal = mysql_query($sqlTotal);
$rowTotal = mysql_fetch_assoc($rsTotal);
// Total de registros sin limit
$total = $rowTotal["total"];
?>
<?php
while ($row = mysql_fetch_assoc($rs))
{
$descripcion = $row["descripcion"];
$id = $row["id"];
$name = htmlentities($row["nombre"]);
?>
<td>
<table width="320" height="80" border="0">
<tr>
<td width="103" height="80" rowspan="2"><a target="_blank" title="<?php echo $name; ?>" href="jugar?id=<?php echo $id; ?>"><img src="jugar/images/<?php echo $id; ?>.gif" alt="" width="100" height="80" border="1" align="top" /></a></td>
<td width="95" height="16" align="left" style="margin:0; padding:0;"><h3><a title="<?php echo $name; ?>" href="jugar/play.php?id=<?php echo $id; ?>" target="_blank"><?php echo $name; ?></a></h3></td>
<td width="108" height="16" style="margin:0; padding:0;" align="center"><img src="images/5.png" width="80" height="15" border="0"/></td>
</tr>
<tr>
<td height="64" colspan="2" class="gamebox" align="left"><?php echo $descripcion; ?></td>
</tr>
</table>
</td>
<?php
}
?>
lo q preisaria es q al imprimir 2 veses ponga un </tr> al final de estos y despues imprima otros 2...
porfavor una manito se agradece
