Posted by zek2005 on 01/22/06 22:01
Hi friends!!!
I'm stuck with something. I want to show some pictures in my site. Max
5 pictures in a row and start a new row. The number of rows must by the
total numbers of pictures available through the "select" divided by 5
and applied the ceil function to round up the result. So, I have the
total number of rows to show. ok, now I have the problem and I copy the
code to ask you for help. The result of the followin code is the first
pictures repeated indefinitely.
Thank you very much!
Ezequiel
$response = mysql_query("select * from fotografias where decada=1970",
$dbase);
if (!$response) {
die('Invalid query: ' . mysql_error());
}
$cantidad= mysql_num_rows($response);
$hasta=ceil($cantidad/5);
echo('<center>');
while($row = mysql_fetch_array($response))
{
for ($i=0;$i=$hasta;$i++)
{
for ($j=1;$j=5;$j++)
{
echo('<img src="' .$row[url]. '" border="0">');
}
echo('<br>');
}
}
[Back to original message]
|