Hello.
If a statement returns false, can I use it with the "!" to evaluate if it was successful like below. ??
function confirmUserExists($username, $password){
/ Verify that user is in database /
$q = "SELECT * FROM ".TBL_USERS." WHERE userlogin = '$username' and password='$password'";
$result = mysql_query($q, $this->connection);
if(!$result || (mysql_numrows($result) < 1)){
return false; //Indicates username failure
}
}
$userExist = $user->confirmUserExists($SESSION['userid'], $SESSION['pass']);
if(!$userExist) {
//do something } else {
do something else
}