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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.