one more quick question, retrieving numbers from database
Posted: Thu Jan 21, 2010 8:25 pm
Hey guys one more question for a while lol, I have been trying to get an if statement to return false by the following criteria and it does not seem to work, however it works if the variable $status=='any-alpha-character-word'.
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.
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
}