I'm pretty new to php. I'm trying to display images on the webpage from mysql database. First, I saved it as longblob, and tried accessing it, but doesnt work. Then, I tried saving the file location in the database as VARCHAR, but it still doesnt work. Any suggestions??
Here's the code!
<?php
require_once ('../mysql_connect.php'); // Connect to the db.
$query = "SELECT * FROM `pictures` WHERE `picture_id` > 0";
$result = mysql_query($query)or die(mysql_error());
$num_results = mysql_num_rows($result);
echo '<P><strong>Number of items found: '.$num_results.'</strong></p>';
for ($i=0; $i <$num_results; $i++){
$row = mysql_fetch_array($result);
echo stripslashes($row['picture_id']);
$image = stripslashes($row['file_path']);
$dispimage = "<img src='C:\apache\htdocs\images\$image'>";
echo $dispimage;
}//end of for loop
?>