A snip of code
$LoginRS__query=sprintf("SELECT user_handle, user_password FROM users_entity WHERE user_handle=%s AND user_password=%s AND activation_status='Active'",
GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text"));
$LoginRS = mysql_query($LoginRS__query, $f12_database_connect) or die(mysql_error());
$loginFoundUser = mysql_num_rows($LoginRS);
if ($loginFoundUser) {
$loginStrGroup = "";
//declare two session variables and assign them
$_SESSION['MM_Username'] = $loginUsername;
$_SESSION['logged_in']="True";
$_SESSION['MM_UserGroup'] = $loginStrGroup;
if (isset($_SESSION['PrevUrl']) && true) {
$MM_redirectLoginSuccess = $_SESSION['PrevUrl'];
}
header("Location: " . $MM_redirectLoginSuccess );
}
else {
header("Location: ". $MM_redirectLoginFailed );
}
}
The database queries users that are activation_status="Active". That field has either of the two values which are "Pending" or "Active". I want to send to another page if the status is "Pending". The page would be for users that haven’t activated their account. How do grab that result and assign it to a variable? Or is there a better approach?
Just select the data without referring to the activation_status and check it with an if statement.
EDIT:
The code you are probably looking for: