You are here: Two for { } « PHP Programming Language « IT news, forums, messages
Two for { }

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>');
}

}

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация