I’m blocked with a very simple Query that it’s not working as I think it should do.
What I want to retrieve is all the rows that:
- have status = 4(it could be 1 too) and/or end is less than current time()
- user_id = $id (exclusively)
- segundamano = ‘1’ (exclusively)
What I’m getting:
- rows with end greater and less than time()
- rows with user_id distinct to the specified $id
- rows with segundamano = ‘0’
I’m pretty sure that I’m missing a stupid thing but I can’t see it.
Here you have an example of my generated Query:
SELECT *
FROM (`solicitudes`)
WHERE `status` = '4'
OR `end` < 1289418069
AND `user_id` = '2'
AND `segundamano` = '1'
PS: Sorry guys if this is a silly question, any direction will be much appreciated. Thanks in advance.
1 Answer