Ver Mensaje Individual
  #7 (permalink)  
Antiguo 06/08/2008, 14:09
Avatar de Sandino
Sandino
 
Fecha de Ingreso: octubre-2006
Mensajes: 277
Antigüedad: 17 años, 6 meses
Puntos: 1
Respuesta: de postgresql a mysql

les explico lo que quiero hacer
una galeria como esta
http://megagalerias.terra.cl/galeria..._galeria=33288
el cual tengo el sig codigo.
Cita:
<? $result=mysql_query($q);
$n= mysql_num_rows($result);
while($row = mysql_fetch_array ($result)){
if (!$sw){
$f=mysql_result($result,0);
$id = $row['id_foto'];
$foto_inicial = $row['id_foto'];
$x = 0;
}else{
$f = mysql_result($result,$x);
$id = $row['id_foto'];
$foto_inicial = $row['id_foto'];

}
?>
<?

if ($foto_inicial==NULL or $foto_inicial == ""){

$f=mysql_result($result,0);
$id = $row['id_foto'];

$foto_inicial = $row['id_foto'];
$x = 0;?>

<img src="../../galeria/<?=$foto_inicial ?>.jpg" width="450" height="338" border="1" />

<?

}else{

?>

<img src="../../galeria/<?=$foto_inicial ?>.jpg" width="450" height="338" border="1" />

<?

}

?></td>



</tr>

<tr>

<td>

<table width="100%" border="1" cellpadding="3" cellspacing="0" bordercolor="#FFFFFF" class="tabla02">

<tr class="tabla02">

<td width="10%"><a href="muestra_galeria.php?sw=1&x=<?=$x - 1; ?>&id_gal=<?=$id_gal?>">Anterior</a></td>

</table>

</td>
<td width="10%"><a href="muestra_galeria.php?sw=2&x=<?=$x + 1; ?>&id_gal=<?=$id_gal?>">Siguiente</a></td>

</tr>

</table>
Algo asi,gracias!