Hello everyone!
I am new and this is just way out of my league at the moment:
$sql = "SELECT SQL_NO_CACHE distinct r.post_id FROM simple_responses r, simple_posts p WHERE r.post_id = p.post_id AND p.post_time > '$cuttime' AND p.public = '1' AND r.user_id != '$user_id' AND p.post_deleted = '0'";
The idea is to show posts that the logged in user hasn't already responded to. So, without "r.user_id != '$user_id'" it returns every post that meets the other constraints.
Everything works just fine except the "!= '$user_id'" portion is completely ignored.
I have spent the last two days trying to figure this out on my own and I have hit the point where I know for certain that I need some help from someone smarter than me.
If that is you, could you tell me what I am doing wrong here?
I know it is ONLY that portion that is failing because I can change it from != to = and it does EXACTLY what it is supposed to do.
As it sits now, it does exactly everything else in the query, just like the "!= '$user_id'" wasn't there at all.
I am sure this is a simple matter for all of you pros here, but I am at a loss.
Would you help me please?
Thank you in advance!