I checked the data query and $status echoes as 1, just like I expect it to,
yet when I test it in the if statement it returns true, and the if statement executes the code within. Does php have a different way for comparing numbers? I tried changing the mysql data field to INT and VARCHAR with no luck.
Code: Select all
$check="SELECT * FROM table WHERE stat='$session->username''";
$query=mysql_query($check);
while ($row = mysql_fetch_assoc($query)) {
$status=$row['status'];
}
if ($status!=="1"){
//Do something
}