MySql, exclude selected row from query or search results
I have spent hours scratching my head, to solve this this simple issue :( .
Basically i have DB table that stores records of users and their details, which contains well over a million rows. The users can login into the system,then can search for other users detail,(name,gender & etc).
The search work fines, the problem is that the search return the results that also include the current logged in users and his/her details. I don't want details of the current logged in user in the search results.
I tried using "WHERE 'userID' != 'loggedinuserId'" , this works, but i wanted to know is their a more effective way going about it?