why am i getting 2 different results with these mysql queries?

Joined
12 Feb 2006
Posts
17,225
Location
Surrey
perhaps a better question would be, why does one work and one not.

these are the 2 queries i have. the top is the one that returns nothing, supposed to be counting how many there are. currently there's 3 that this should bring back.

Code:
SELECT COUNT(id) FROM quotes WHERE hide !=1 && booked > '0' && date='29/07/2021'

Code:
SELECT * FROM quotes WHERE hide != 1 && date='29/07/2021' && booked > '0' ORDER BY id DESC LIMIT 50 OFFSET 0

the second returns the 3 rows correctly. what am i missing?

if i do this query without the date it works fine for both. if i replace date with say && service = 'cleaning'

this also works fine for both.

if i remove the && booked > '0' part, this also means it all works fine.
 
Back
Top Bottom