我已经检查了这个问题的所有先前版本,在这些情况下很明显它为什么不起作用但是当我查询我的数据库时它没有返回任何行。现在只有一行,所以我完全混淆了为什么查询返回空。任何建议都会有所帮助。
$prodSQL = "SELECT * FROM products INNER JOIN shopPage ON products.storePage_id = shopPage.storePage_id
INNER JOIN gallery ON products.gallery_id = gallery.gallery_id
INNER JOIN image ON products.image_id = image.image_id WHERE products.storePage_id = ".$_GET['shop_id'];
$productInfo = $conn->query($prodSQL) or die ("Couldn't execute query: ".mysqli_error($prodSQL));
$row = $productInfo->fetch_assoc();
$gallery_id = $row['gallery_id'];
$mainTitle = $row['storePage_title'];
if($productInfo->num_rows === 0)
{
echo 'No results';
}
$productInfo->close();