Hola tengo un problema con esta pagina cuento:
estan puestas fotos pero quiero decirle que haga tres filas y tres columnas
en el video tutorial que estoy haciendo en principio es asi:
<?php
$cuantos=0;
do {
if($cuantos==0){
?>
<tr>
<?
}
$cuantos ++;
?>
<?
if($cuantos==3){
$cuantos=0;
?>
</tr>
<?
}
?>
<?php } while ($row_listado = mysql_fetch_assoc($listado)); ?>
Si añado esto dos codigos me da un error :
Parse error: parse error in C:\wamp\www\Usuarios\index.php on line 311
<!-- InstanceEnd --></HTML>
<?php
mysql_free_result($listado);
?> ( ESTA SERIA LA 311)
Asi quedaria la tabla:
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<?php
$cuantos=0;
do {
if($cuantos==0){
?>
<tr>
<?
}
$cuantos ++;
?>
<td align="center"><a href="detalle.php?foto_id=<?php echo $row_listado['foto_id']; ?>"><img src="fotos/peques/<?php echo $row_listado['nombre']; ?>" border="0" /></a><strong><br />
<?php echo $row_listado['lugar']; ?></strong><br />
<?php echo $row_listado['precio']; ?> Euros<br />
<form id="form1" name="form1" method="post" action="carrito_compra.php">
<input name="cantidad" type="hidden" id="cantidad" value="1" />
<input name="precio" type="hidden" id="precio" value="<?php echo $row_listado['precio']; ?>" />
<input name="lugar" type="hidden" id="lugar" value="<?php echo $row_listado['lugar']; ?>" />
<input type="image" name="imageField" src="imagenes/carrito.gif" />
</form>
</td>
<?
if($cuantos==3){
$cuantos=0;
?>
</tr>
<?
}
?>
<?php } while ($row_listado = mysql_fetch_assoc($listado)); ?>
</table>