I'm trying to create a product page from a query result (store ID) that gets sent from a previous page and I need help trouble-shooting the code. I do not get any errors on the results page, but I also do not get any output from the database either when I attempt to echo in the results. Here is my code:
<?php
include 'connect\mbh.php';
$conn = OpenCon();
echo "Connected Successfully";
if (mysqli_connect_errno()) {
printf("Connect failed: %s\n", mysqli_connect_error());
exit();
}
$store = $_GET['STORE_ID'];
$query = "SELECT * FROM stores WHERE 'STORE_ID' = '$store'";
if ($result = $conn->query($query)) {
/* fetch object array */
while ($row = $result->fetch_row()) {
printf ("%s (%s)\n", $row[0], $row[1]);
}
/* free result set */
$result->close();
}
/* close connection */
$conn->close();
?>
And then later in the text of the site I try to echo in results from the database:
<img src="images/b_logos/<?php echo $row['LOGO']; ?>
Any ideas on what I'm doing wrong? I'm clearly a beginner at this! Thanks