So I asked a similar question yesterday, and got a great response - I'm hoping for the same luck this time around. What I'm trying to create is paged results for a MySQL query. I'm taking advantage of LIMIT. Here is my query.
SELECT
BookingInfo.ClinicID, BookingInfo.BookingDate, BookingInfo.BookingTime,
BookingInfo.Status, PatientBooking.FirstName, PatientBooking.LastName,
PatientBooking.DateOfBirth
FROM BookingInfo
LEFT JOIN PatientBooking
ON BookingInfo.PatientID = PatientBooking.PatientID
WHERE PatientBooking.FirstName = 'Brian'
AND PatientBooking.LastName = 'Lang'
AND (BookingInfo.ClinicID = '1' OR BookingInfo.ClinicID = '2')
LIMIT '0, 20'
ORDER BY BookingInfo.BookingDate DESC
This query does not work (However if I remove the LIMIT '0,20' part it works just fine). Instead I get this error returned: #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''0, 20' ORDER BY BookingInfo.BookingDate DESC' at line 1
Any ideas from the experts?