Jump to content

Retrieving images from MySQL


solonman123

Recommended Posts

Hi Everyone!  Just learning php.  Hope someone can help with this.  Trying to design a product page of photo images with price, description, etc.  At this point I am ignoring the design and just trying to get the fields to populate.  They all work through my "while" loop except I cannot find the syntax for the image and am just getting the placeholder.  My images are just "image".jpg in my root folder.  Ex. building.jpg. And my table column is "picture_image".

 

Appreciate any help.  Here is the pertinent code which works fine except for the image $ROW.  I have bolded the trouble block.  Thanks!

 

while($row = mysqli_fetch_assoc($result))         

{

 

  // display row for each picture

  echo "<tr>\n";

  echo " <td>{$row['Picture_ID']}</td>\n";

  echo " <td style='font-weight: bold;

            font-size: 1.1em'>{$row['Picture_name']}</td>\n";

  echo " <td>{$row['Picture_description']}</td>\n";

  echo " <td>{$row['Picture_price']}</td>\n";

 

     

  echo "<td><a href={$row['picture_image']}'

                          border='0'>

                  <img src='{$row['picture_image']}'

                  border='0' width='100' height='80' />

                </a></td>\n";               

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.