I'm trying to do the following:
But for some reason I don't get the results I want. See my following code:
SELECT *, MONTH(datetime) AS month
FROM $table_name
WHERE YEAR(datetime) = $current_year
AND find_in_set('%$user_id%', users)
AND NOT find_in_set('%$user_id%', accepted) OR NOT find_in_set('%$user_id%', rejected)
ORDER BY datetime
Put the NOT
clause condition in parenthesis.
WHERE YEAR(datetime) = $current_year
AND find_in_set('%$user_id%', users)
AND ( NOT find_in_set('%$user_id%', accepted)
OR NOT find_in_set('%$user_id%', rejected) )
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.