Page 1 of 1

oh not him again

Posted: Fri May 02, 2003 7:10 am
by Deddog
How can i extract the most recent and last entered bit of data from the below returned results, or how can i modify this statement to only bring back the most last enetered row?


Php/Mysql

$sql = "select booked.*, rooms.RoomName, rooms.GuardianId from booked LEFT JOIN rooms
ON booked.RoomsId = rooms.RoomsId
WHERE booked.WhoId = '$EmployeeId' AND booked.BookedDate = '$ReturnDate' and BookedTime = '$TimesAM' ";

Posted: Fri May 02, 2003 7:32 am
by []InTeR[]
By order and limit

$sql = "select booked.*, rooms.RoomName, rooms.GuardianId from booked LEFT JOIN rooms
ON booked.RoomsId = rooms.RoomsId
WHERE booked.WhoId = '$EmployeeId' AND booked.BookedDate = '$ReturnDate' and BookedTime = '$TimesAM' order by BookedTime DESC LIMIT 1";

ah ha

Posted: Fri May 02, 2003 8:03 am
by Deddog
Once again, thank you :)