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. Quote 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']."' />"; ?> Quote 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. Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.