Jump to content

Displaying Image From Table


twilitegxa

Recommended Posts

Now I am trying to display the images from my table and I have almost got it working, except for one small thing --- it seems to be displaying all the records, but instead of displaying the right image for each record, it's displaying the same image across all the records. Can anyone tell me what I have done wrong?

 

 


this is the gallery


<?php
$dbhost = 'localhost';
$dbuser = 'webdes17_lizkula';
$dbpass = 'minimoon';


$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die                      ('Error connecting to mysql');


$dbname = 'webdes17_jewelry';
mysql_select_db($dbname);


$all_records = "SELECT * FROM gallery";
$all_records_res = mysql_query($all_records);
$image = mysql_result($all_records_res, 0, 'image');


while($nt=mysql_fetch_array($all_records_res)){
echo "<img src=http://www.webdesignsbyliz.com/wdbl_wordpress/wp-content/themes/twentyten_2/upload/$image>";
}


?>

 

 

I'm guessing I have the $image variable in the wrong place, but when I tried placing it within the while statement, the page never loaded, and instead acted like it was loading forever. What am I doing wrong? Here is the link to the page so you can see what is happening:

 

 

http://webdesignsbyliz.com/wdbl_wordpress/test-submit/

Link to comment
https://forums.phpfreaks.com/topic/228133-displaying-image-from-table/
Share on other sites

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.