solonman123 Posted September 19, 2011 Share Posted September 19, 2011 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"; Quote Link to comment https://forums.phpfreaks.com/topic/247440-retrieving-images-from-mysql/ Share on other sites More sharing options...
ManiacDan Posted September 19, 2011 Share Posted September 19, 2011 Well...what does $row['picture_image'] contain? View the HTML source and see what that image tag looks like. Maybe you just need it to say: src="{$row['picture_image']}.jpg" But we need more info than that. -Dan Quote Link to comment https://forums.phpfreaks.com/topic/247440-retrieving-images-from-mysql/#findComment-1270688 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.