Jump to content

How to create a loop for images (mysql + fileserver)


The_Dude_1978

Recommended Posts

Hi there,

 

I hope somebody can help me creating a loop for the following code:

What it currently does is, showing only 1 image, while in fact there are 3 of them.

I've combined a loginsystem with slideviewer. When i use the original php code (or a part of it) it only shows one listing. I need it to list all of them.

 

 

<div id="mygalone" class="svw"><ul>	<li>	<?php$result = mysql_query("SELECT reference FROM user_photos WHERE`profile_id`='".$row['id']."'");while ($row2 = mysql_fetch_array($result, MYSQL_ASSOC)){	echo "<a href=\"".$_GET['username']."/pics/".$row2['reference']."\">	<img src=\"".$_GET['username']."/pics/thumbs/".$row2['reference']."\"></a><br/><br/>";}}?>	</li></div>

 

 

What can be stripped down to this:

 

 

<?php { $result = mysql_query("SELECT reference FROM user_photos WHERE`profile_id`='".$row['id']."'");			while ($row2 = mysql_fetch_array($result, MYSQL_ASSOC))			{ 			echo "<img src=\"".$_GET['username']."/pics/".$row2['reference']."\">"; 			} 		} ?>

 

 

 

You would asume that this is allready a loop, but it does not act like it.

 

Best regards,

 

Martijn (the netherlands)

 

[attachment deleted by admin]

No i did not check that. Can you tell me how to do that?

 

Furthermore:

I've been searching on internet for a solution, and a light hit me (god bless the angels).

 

The code for the li was as follows:

echo "<li><img src=\"".$_GET['username']."/pics/".$row2['reference']."\"></li>";

 

Now i got a list of 3 images as supposed to, BUT, the images are all the same. That does'nt match up, because there are 3 different images.

 

Can you help me?

 

Best regards,

 

Martijn

Hi there,

 

I'm very sorry to have troubled you guy's looking at the code. Ok, i fixed the li problem myself, but i needed to use an old version of jquery easing. In the name of the 1.3 it was like jquery.easing.1.3.js but the old file i needed to use was jquery-easing.1.2.js. I only change from 3 to 2, but not from . to - . So in fact is all working, but the reference was'nt right. Sorry again.

 

Best regards,

 

Martijn

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.