Hi, I decided to try and upload images by storing their path in a database, but have run into an error when displaying the images. The form works and the folder is populated whenever I run the script. I have tried a lot of solutions from similar threads, but to no avail. My view.php is;
<?php
include 'connect.php';
$query = "SELECT * FROM upload2 ";
$result = mysql_query($query) or die('Error, query failed');
$num = mysql_fetch_array($result);
$path = $row['path'];
if ($num > 0){
echo "<p>There is an image in here!;</p>";
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)){
echo "<img src='$path' />";
}
}
?>
Can anyone help?