Reputation: 2071
I have a mysql row with 'date = 2013-05-02, type = 1' etc.
Then I run this query
SELECT date, type, status, rate
FROM reservation
WHERE type = 1
AND date BETWEEN 2013-05-01 AND 2013-05-08
ORDER BY date asc
LIMIT 0, 10
But this returns empty results. What is the query issue here?
Upvotes: 0
Views: 44
Reputation: 1523
Put the dates in quotes '
in the mysql query.
SELECT date, type, status, rate
FROM reservation
WHERE type = 1
AND date BETWEEN '2013-05-01' AND '2013-05-08'
ORDER BY date ASC
LIMIT 0, 10 ;
Upvotes: 2