query(" SELECT r.*, AVG(ra.rating) as avg_rating FROM restaurants r LEFT JOIN ratings ra ON r.id = ra.restaurant_id GROUP BY r.id ORDER BY avg_rating DESC LIMIT 6 "); $top_restaurants = $stmt->fetchAll(); // Fetch featured cuisines $stmt = $pdo->query("SELECT * FROM cuisines ORDER BY name ASC LIMIT 6"); $cuisines = $stmt->fetchAll(); ?>