I have this query:
SELECT id, name FROM users
WHERE ((id = 1) OR (5 <= 5))
This should result all records as 5 = 5, but it’s not. It’s only resulting records where the id = 1.
What am I doing wrong?
EDIT:
This is the full query:
SELECT project_id, project_name, project_description, project_active,
users.user_firstname, users.user_lastname FROM projects
INNER JOIN users ON projects.user_id = users.user_id
WHERE (projects.user_id = 1 || 3 <= 3)
EDIT:
Found it =/
Something was wrong with the join; user_id didn’t exist anymore for some reason.
Try:
u will find mysql executes the query is:
just means (id=1 or 5<=5) is same as 1