herghost Posted May 26, 2011 Share Posted May 26, 2011 Hi Guys I am having problems with the below, I am assuming I have formated the if statement incorrectly but I cant see my mistake as nothing shows? <?php $query = mysql_query("SELECT * FROM user_profile WHERE username = '$username'"); $results = mysql_fetch_array($query); if($results['followers'] < 150 && $results['posts'] < 300 && $results['days'] > 0 && $results['status'] = 0) { echo 'ok' } The database for the said user looks like: followers days posts status 1 182 1 0 All fields are INT Many Thanks Quote Link to comment https://forums.phpfreaks.com/topic/237524-multiple-if-statement/ Share on other sites More sharing options...
PFMaBiSmAd Posted May 26, 2011 Share Posted May 26, 2011 One = sign is an assignment operator. Two == signs is a comparison operator. Quote Link to comment https://forums.phpfreaks.com/topic/237524-multiple-if-statement/#findComment-1220564 Share on other sites More sharing options...
herghost Posted May 26, 2011 Author Share Posted May 26, 2011 Doeth! As usual PFMaBiSmAd you prove yourself to be indispensable, please never leave these forums, Ive lost count of how many times you have helped me over the years Quote Link to comment https://forums.phpfreaks.com/topic/237524-multiple-if-statement/#findComment-1220567 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.