RE: [PHP] loop structure(SOLVED)
Thx, it works like a charm I think the mysql_fetch_assoc was the thing I was looking for. -Oorspronkelijk bericht- Van: Robert Cummings [mailto:[EMAIL PROTECTED] Verzonden: zaterdag 9 september 2006 17:36 Aan: [EMAIL PROTECTED] CC: php-general@lists.php.net Onderwerp: Re: [PHP] loop structure Untested... ... ... ' .$item['picture'] .'' .'' .' ' .''; } } } } ?> Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] loop structure
On Sat, 2006-09-09 at 16:49 +0200, Reinhart Viane wrote: > I've been experimenting some time now but i can't get it right. > I have a database in which I have a table with a list of photo_url > > Table: photos > Idphoto_url > 1 photos/boeket_s40.jpg > 2 photos/boeket_k12.jpg > 3 photos/boeket_z23.jpg > ... > > > I get this out of the database with this query: > $sqlphoto="select * from photos where photo_type='$category'"; > $exephoto=mysql_query($sqlphoto) or die (mysql_error()); > > Now I need a loop so that the photos are put into a table: > > > > > >valign="top"> > PICTURE HERE > >PICTURE HERE > >PICTURE HERE > > > > > > > > > > > > > > > The first must be looped as long as there are photos in the array (so > something like #lines in array/3, with ceil()) > In each there are 3 pictures in it's tags: > so maybe something like > for ($i=1;$i<3;$i++){ > PICTURE HERE > > } > > I have tried several thing and I'm able to create the correct amount of rows > and the loop for the 3 cells in the row. > Unfortunately it always only shows the first picture from the array in each > of those cells. > > Can someone help me out? THX Untested... ... ... ' .$item['picture'] .'' .'' .' ' .''; } } } } ?> Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] loop structure
I've been experimenting some time now but i can't get it right. I have a database in which I have a table with a list of photo_url Table: photos Id photo_url 1 photos/boeket_s40.jpg 2 photos/boeket_k12.jpg 3 photos/boeket_z23.jpg ... I get this out of the database with this query: $sqlphoto="select * from photos where photo_type='$category'"; $exephoto=mysql_query($sqlphoto) or die (mysql_error()); Now I need a loop so that the photos are put into a table: PICTURE HERE PICTURE HERE PICTURE HERE The first must be looped as long as there are photos in the array (so something like #lines in array/3, with ceil()) In each there are 3 pictures in it's tags: so maybe something like for ($i=1;$i<3;$i++){ PICTURE HERE } I have tried several thing and I'm able to create the correct amount of rows and the loop for the 3 cells in the row. Unfortunately it always only shows the first picture from the array in each of those cells. Can someone help me out? THX -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php