Order from Majuro's best
All Restaurants
query("SELECT id, name, cuisine, image_url, rating, rating_count FROM restaurants ORDER BY name");
$restaurants = $stmt->fetchAll();
foreach ($restaurants as $restaurant) {
echo '';
echo '
';
echo '
';
echo '
';
echo '';
}
} catch (PDOException $e) {
echo '' . htmlspecialchars($restaurant['name']) . '
'; echo '' . htmlspecialchars($restaurant['cuisine']) . '
'; if (isset($restaurant['rating']) && $restaurant['rating'] > 0) { echo ''; } else { echo ''; } echo 'Error: Could not fetch restaurants from the database.
'; } ?>