Hey FireFly, you might want to check me on this one...
I looked into this because I have not been able to see any searchs that I am performing.. Based on the below quote from the MySQL manual:
Quote:
If there is no matching record for the right table in the ON or USING part in a LEFT JOIN, a row with all columns set to NULL is used for the right table.
|
If the search was performed by a guest which has an account value of "0", it tries to do the NOT IN which it can not compare to anything because that account does not exist in the user table...
I think this should be a correct query, I have tested here and it is working with no issues:
SELECT searchid,postids,dateline,querystring FROM search LEFT JOIN user USING (userid) WHERE querystring!="" AND (usergroupid NOT IN (5,6,7) OR search.userid = "0") ORDER BY searchid desc LIMIT 0,10
Also, as a note to some people, I had to upgrade my search.php in order the get the links created correctly so other users could access them. Otherwise, I got a user is not authorized message.
Enjoy this info folks.... !!