antonyjohn Posted August 3, 2007 Share Posted August 3, 2007 hai friends i have one problem in my programming.there is a table containing some details of the product with its image.. in view section in my php page ,i need to show this image and the rest of the fields in the table in a row... plzzz help me out on how to do it Quote Link to comment https://forums.phpfreaks.com/topic/63206-need-help-with-image-display-from-database/ Share on other sites More sharing options...
peterbarone Posted August 3, 2007 Share Posted August 3, 2007 I do something like this and it works well for me. Hope it help <img src=\"/imagesfolder/$row[imagename]\" > Quote Link to comment https://forums.phpfreaks.com/topic/63206-need-help-with-image-display-from-database/#findComment-315025 Share on other sites More sharing options...
antonyjohn Posted August 3, 2007 Author Share Posted August 3, 2007 hai friends i have one problem in my programming.there is a table containing some details of the product with its image.. in view section in my php page ,i need to show this image and the rest of the fields in the table in a TABLE Row... plzzz help me out on how to do it Note: it shuld be displayed in a table Quote Link to comment https://forums.phpfreaks.com/topic/63206-need-help-with-image-display-from-database/#findComment-315042 Share on other sites More sharing options...
GingerRobot Posted August 3, 2007 Share Posted August 3, 2007 It'll look something along the lines of: <table> <tr><td>Var1</td><td>Var2</td><td>Image</td></tr> <?php $sql = "SELECT * FROM `yourtable`"; $result = mysql_query($sql) or die(mysql_error()); while($row = mysql_fetch_assoc($result)){ echo '<tr><td>'.$row['var1'].'</td><td>'.$row['var2'].'</td><td><img src="images/'.$row['images'].'" /></td></tr>'; } ?> </table> Quote Link to comment https://forums.phpfreaks.com/topic/63206-need-help-with-image-display-from-database/#findComment-315049 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.