I have this php statement in my login script...
else if ($_POST['email'] === $details['email'] &&
$_POST['password'] === $details['password'] &&
is_null($details['logcount'])) {
echo 'Account not active!';
}
In my mysql table the logcount by default is NULL, when a user activates their account the logcount turns to 0 then increments every time they login.
On my login script I am having trouble with PHP testing it to see if it is NULL or not. I have pulled all the users data via an associative array using PDO.
Thanks in advance.
var_dump($details['logcount'])display? I only ask asis_null()returns true fornullandfalsefor0and"0"so your code should work as expected.var_dump($details);to see what's actually in there. While your at it, do avar_dump($_POST)to make sure that everything is as expected. You can also break down each of the three comparisons to see which one is failing.