jester626 Posted November 24, 2006 Share Posted November 24, 2006 Could someone have a look at this "IF" statement and give me some pointers on how I can go about making it work.if ($POST_[username] = $row_checkregistration['username'] OR ($POST_[emailaddress] = $row_checkregistration['EmailAddress'])) If I remove everything after the "OR" clause, the code works fine so I know the problem is from the "OR" to the end somewhere.ThanksJester Link to comment https://forums.phpfreaks.com/topic/28335-help-with-if-statement/ Share on other sites More sharing options...
kenrbnsn Posted November 24, 2006 Share Posted November 24, 2006 You have many errors:[list][*]The comparison operator is "==" not "=".[*]The POST array is named $_POST, not $POST_[*]All associative array indices should be quoted if they are strings[*]You should be using the logical operator "||" instead of the word "OR"[/list]Try something like this:[code]<?phpif ($_POST['username'] == $row_checkregistration['username'] || $_POST['emailaddress'] = $row_checkregistration['EmailAddress'])?>[/code]Ken Link to comment https://forums.phpfreaks.com/topic/28335-help-with-if-statement/#findComment-129603 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.