seco;10924468 wrote:Try this then
$date = $_POST['date'];
$sql = "SELECT * FROM bookings ORDER BY datebookings ASC";
$result = mysql_query($sql) or die(mysql_error());
echo "<ul>";
while($row = mysql_fetch_array($result))
{
if ($row['datebookings'] == $date){
//echo "<li>".$row['car']." - Out</li>";
}else{
echo "<li>".$row['car']." - Available</li>";
}
}
echo "</ul>";
}
you can uncomment the Out echo to show the cars out aswell.
Hi thanks for our reply again. The problem with the above code si that i might have 100 enterys in my database
date, car booked
This would then echo out all the other cars corresponding to other dates.
there are 5 cars car1 car2 car3 car4 and car 5
each database record has a date and the name of the car
so it might look like this
30/01/2010 - car1
27/03/2010 -car3
27/03/2010 - car4
04/05/2010 - car1
06/06/2010 -car5
06/06/2010 - car4
and so on
So what i want to do is when the date say 06/06/2010 is entered the list would show:
car1
car2
car3
if the date 04/05/2010 was entered the list would show
car2
car3
car4
car5