connect_errno) { echo "

MySQL error no {$mysqli->connect_errno} : {$mysqli->connect_error}

"; exit(); } //select most popular cars from db (cars with the highest booking_count) $popular = "SELECT * from cars order by booking_count desc limit 5"; ?>

Most popular cars. Login now to make a booking!

query($popular); if ($result->num_rows > 0) { while($found = $result->fetch_array()){ //echo most popular cars echo "

new".$found["car_brand"]."Description


  • ".$found["car_cc"]."cc


  • Locations:
    ".$found["car_address"]."

".$found["car_price"]." Euro
per day

Booked ".$found['booking_count']." times.

x

".$found["car_description"]."

"; } } else if ($result->num_rows == 0){ echo "No cars found"; } else { echo "

MySQL error no {$mysqli->errno} : {$mysqli->error}

"; exit(); }?>