Here is the query:
$sql_email_check = mysql_query("SELECT * FROM users
WHERE 'userid'!='$userid'
AND email_address='$email_address'")
or die ('Error in query: '.$sql_email_check.'. ' .mysql_error());
The user is able to update their info, but they don't need to change all of it. This is trying to check if anyone is already using the email address they inserted. If they haven't changed their email address, then it will say sorry, that email addy is in use.
I am trying to prevent it sending that error by selecting any email address that matches, that is not theirs. This query still matches their email. I need it not to.