El codigo es:
Código PHP:
<?
include ("conexion.php");
if(empty($_GET["id"]))
{
$_pagi_sql = "select * from tufoto ORDER BY id DESC";
}
else
{
$_pagi_sql = "select * from tufoto where id='".$_GET["id"]."' ORDER BY id DESC";
}
//Leemos y escribimos los registros de la página actual
while($row = mysql_fetch_array($query))
{
?>
<div align="center"><table width="550" align="center" cellpadding="5" cellspacing="5">
<tr><td colspan="2">
<img src="tufoto/<?=$row["archivo"];?>" /></td></tr>
<tr><td colspan="2" bgcolor="#dddddd"><div class="tufoto-comentario"><?=$row["comentario"];?></div></td></tr>
<tr><td width="275"><?=$row["votos"];?> Votos</td>
<td width="275"><div align="right"><a href="<?=$_SERVER['REQUEST_URI'];if(empty($_GET["id"])){echo '&id='.$row["id"];}?>&votar=si"><img src="archivos/btnCalificar.jpg" width="162" height="30" border="0"></a></div></td>
</tr>
</table>
</div>
<?
}
mysql_free_result($query);?>