Im having a issue with my code i am working on. I am trying to get a include loaded depending on the status of the user (if they paid and if they have a invalid email. The NULL value is being pulled form the database however it only sends to the entermail.php
Here is my code does anyone see whats wrong?
function is_premium() {
$premium_query = mysql_query("SELECT 'authLevel' FROM 'users' WHERE 'fbID' ='".$userId."'");
$premium = mysql_query($premium_query);
if ($premium=='1') {
return true;
} else {
return false;
}
}
function valid_email() {
$validemail_query = mysql_query("SELECT 'parentEmailOne' FROM 'users' WHERE 'fbID' ='".$userId."'");
$validemail = mysql_query($validemail_query);
if ($validemail != 'NULL') {
return true;
} else {
return false;
}
}
if (!empty($session) && is_premium() && valid_email()) {
include 'indexPremium';
} else if (!empty($session) && valid_email()) {
include 'entermail.php';
} else if (!empty($session)) {
include 'indexLoggedIn.php';
}else{
include 'indexNotLogged.php';
}
You’re not actually storing the string “NULL” in the database are you? Null is not the same as string “NULL” — perhaps you want something like:
Or shorter: