I am trying to display an image using php. The image is stored in MYSQL table. I am able to retrieve the information from mysql in my php code, but i am having trouble displaying the image.
$db_link = mysql_connect($host_name, $user_name, $password) or die("Could not connect to $host_name");
mysql_select_db("gameportal") or die("Could not select database $db_name");
$query = "select * from gamesinfo;";
$result = mysql_query($query, $db_link) or die("Could not select");
$Row = mysql_fetch_row($result);
echo "$Row[0]<br>";
echo "$Row[1]<br>";
echo "<img src="$Row[7]" class="body" alt="" /> <br>";//image
echo "$Row[5]<br>";
Row 7 contains the location of the image (in this case a weblink). When i try to display the webpage, the page is blank, nothing shows, but when i remove that line with the pic, the webpage shows with the remaining info. What am i doing wrong?
mysqliinstead ofmysql. Object oriented will save you typing.