I asked a question on here earlier which was answered very quickly and concisely, thanks for that :).
But now I have a problem where my search script is pulling the current user from the database when I don’t want it to. Let’s say I’m logged in with the account: MrDare360.
I don’t want to pull my info from the database, only other peoples info with my search script. I have tried using NOT LIKE and != in my SQL query to remove my result from the database but it is not working.
This is my current code: http://pastebin.com/GXAbQJRb
And this is my database: http://gyazo.com/4b725e7e283d963ad4d0652da0a52a92
What would be the easiest or best way to do this? Thanks.
EDIT: The current users username, email and id are stored in sessions, I want to use these to restrict the search script from pulling your account results.
This should work:
Note that I’m assuming that your username session variable is safe for SQL. Also note that you should be using prepared statements whenever you’re dealing with external data.