nashsaint Posted May 5, 2009 Share Posted May 5, 2009 Hi, Purpose: to echo an image. filename is stored in sql (e.g., mypix.jpg), and actual images stored inside images/ folder. sql query: mysql_select_db($database_cr, $cr); $query_topThree = "SELECT logs.eng_name, eng_names.eng_img FROM logs, eng_names WHERE eng_names.eng_name = logs.eng_name LIMIT 3"; $topThree = mysql_query($query_topThree, $cleanroom) or die(mysql_error()); $row_topThree = mysql_fetch_assoc($topThree); My echo so far: <?php echo "<img src='images/'" . $row_topThree['eng_img']; ?> Result: didn't work. nothing is displayed. Your help is greatly appreciated. Link to comment https://forums.phpfreaks.com/topic/156925-solved-how-to-echo-an-image-filename-from-sql/ Share on other sites More sharing options...
JonnoTheDev Posted May 5, 2009 Share Posted May 5, 2009 <?php echo "<img src='images/".$row_topThree['eng_img']."' />"; ?> Link to comment https://forums.phpfreaks.com/topic/156925-solved-how-to-echo-an-image-filename-from-sql/#findComment-826604 Share on other sites More sharing options...
nashsaint Posted May 5, 2009 Author Share Posted May 5, 2009 works like a charm... thanks neil.johnson. Link to comment https://forums.phpfreaks.com/topic/156925-solved-how-to-echo-an-image-filename-from-sql/#findComment-826606 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.