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
https://forums.phpfreaks.com/topic/247440-retrieving-images-from-mysql/
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.