Shadowing Posted December 25, 2011 Share Posted December 25, 2011 This if statment is coming up true when its suppose to be false Only reason I can think of is there is a ton of rows with id matching $_session['user_id'] which doesnt make any sense to me <?php $check3 = "SELECT id FROM pm WHERE id='".mysql_real_escape_string($_SESSION['user_id'])."'"; $check2 = mysql_query($check3) or die(mysql_error()); $check1 = mysql_num_rows($check2); if(empty($check1['id'])){ echo "Your Inbox is Empty"; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/253818-if-statment-issue/ Share on other sites More sharing options...
SergeiSS Posted December 25, 2011 Share Posted December 25, 2011 What are you going to do I wonder??? $check1 is an integer value because you just assign an integer to it. But you check it as the element from array $check1.... Do you think it's a good idea? Quote Link to comment https://forums.phpfreaks.com/topic/253818-if-statment-issue/#findComment-1301247 Share on other sites More sharing options...
Shadowing Posted December 25, 2011 Author Share Posted December 25, 2011 opps I meant to use $check1 = mysql_fetch_array($check2); its working now lol Thanks alot I was trying another approach before that and forgot to change it Quote Link to comment https://forums.phpfreaks.com/topic/253818-if-statment-issue/#findComment-1301250 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.