Jump to content

[SOLVED] how to echo an image filename from sql?


nashsaint

Recommended Posts

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.

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.