Scorpion28 Posted December 28, 2011 Share Posted December 28, 2011 This is suppose to check a table to see if it has a value in it. I get this error: Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /homepages/6/d365637117/htdocs/EE Live/Active/Inc/session.php on line 33 This is the code if($checkProfile) { $result = mysql_query("SELECT prof_pic FROM members_profile WHERE id = '".$_SESSION['EEID']."'"); $mem_num_rows = mysql_num_rows($result); if($mem_num_rows =1) { } Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted December 28, 2011 Share Posted December 28, 2011 When posting code, enclose it within the forum's . . . BBCode tags. Quote Link to comment Share on other sites More sharing options...
Psycho Posted December 28, 2011 Share Posted December 28, 2011 Your query is failing. Either you have not connected to the db properly or there is a typo in your query. Try using this to see what the error is $query = "SELECT prof_pic FROM members_profile WHERE id = '".$_SESSION['EEID']."'"; $result = mysql_query($query) or die("Query: {$query}<br>Error: " . mysql_error()); $mem_num_rows = mysql_num_rows($result); if($mem_num_rows =1 Quote Link to comment 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.