hello
i have a problem with images
i use the function mysql_num_rows for to obtein the images and, i want the show images in files of 5
my code is :
help me, please!!!!!PHP Code:<?php
extract($HTTP_GET_VARS);
require_once('funciones.php');
$lnk = Cnn();
$sql = "select * from imagenes3 where img_of_id=$of_id";
@$rs = mysql_query($sql,$lnk);
$cant = mysql_num_rows($rs);
if($cant==0){echo " ";
}
if(isset($HTTP_GET_VARS['imagen_mostrar']))
{
$show = $HTTP_GET_VARS['imagen_mostrar'];
}
else
{
$show = mysql_result($rs,0,"img_id");
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Documento sin título</title>
<style type="text/css">
<!--
body {
background-color: #EAEAEA;
}
-->
</style></head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="5"><div align="center"><?php echo "<img border='3' src='imagen.php?img_id=$show&tamanio=600'>"; ?></div></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<?php
$filas = $cant/5;
if($filas<1){$filas=1;}
for($i=1;$i<=$filas;$i++)
{
echo " <tr>\n";
for($i=1;$i<=$cant;$i++)
{
$x+=1;
if($x<=$cant)
{
$img_id = mysql_result($rs,$i-1,"img_id");
echo " <td width='20%'><div align='center'><a href='?of_id=$of_id&imagen_mostrar=$img_id' title='Click para ver...'><img border='3' src='imagen.php?img_id=$img_id&tamanio=100'></a></div></td>\n";
}
else
{
echo " <td width='20%'><div align='center'> </div></td>\n";
}
}
echo " </tr>\n";
}
?>
</table>
</body>
</html>
<?php
mysql_free_result($rs);
mysql_close($lnk);
?>
i dont know where is my fault!!!!
cheers
pd: sorry for my english, is very bad






Bookmarks