i am unable to get images from my database, images are located in a folder, i am using the location of a city, to get images from melbourne, where i am able to view the images. i have gotten it to view the names, and broken image links but am unsure why this is not working
<?php include(’_includes/connection.php’);
if (isset($db) === true) {
// could use header redirection to error page
}
if(!empty($GET[‘id’])){
$id = intval($GET[‘id’]);
$sql = “SELECT PictureID, PhotoName, LocationId
FROM picture
where LocationId=’$id’”;
}else{
//header(“Location: http://localhost/testWorldPic/index.php”);
exit();
}
//use an approach which mixes object oriented with mysql … code
$query = $db->query($sql);
// testing loop which is similar to using php "mysql…" functions in appearance - loops through the associative array
while($row = $query->fetch(PDO::FETCH_ASSOC)){
echo ‘<a href="pictures.php?id=’ .$row[‘LocationId’]. ‘">’ .$row[‘PhotoName’]. ‘</a><br/>’;
echo ‘<img src="photos/’ .$row[‘PhotoName’].’ height=“300” width=“200” />’. ‘</a><br/>’;
}
?>