I am trying to retrieve images from my database, everything else works and is retrieved ok from the database except the images, does anyone have any idea what im doing wrong? the code im using is shown below:
$query = "SELECT p.name, p.image, p.price, p.description, p.category_id, ci.quantity
FROM products p
LEFT JOIN cart_items ci
ON p.id=ci.product_id
WHERE p.id=?
LIMIT 0,1";
$stmt = $con->prepare( $query );
$stmt->bindParam(1, $id);
$stmt->execute();
$row = $stmt->fetch(PDO::FETCH_ASSOC);
$name = $row['name'];
$image = $row['image'];
$price = $row['price'];
$description = $row['description'];
$category_id = $row['category_id'];
$quantity = $row['quantity'];
?>
<!-- HTML form for updating a product -->
<table class='table table-hover table-responsive table-bordered' style='margin:1em 0 0 0;'>
<tr>
<td style='width:30%;'>Name<?php echo "<div class='product-id' style='display:none;'>{$id}</div>"; ?></td>
<td class='product-name' style='width:70%;'><?php echo $name; ?></td>
</tr>
<tr>
<td>Image</td>
<td><?php echo '<img src=""images/'.$image.'" />'; ?></td>
</tr>
It currently shows a blank box when this is in the web browser, it doesnt seem to be finding the images which are in a folder called images