fife Posted December 15, 2010 Share Posted December 15, 2010 ok really simple question. I'm going blind staring at this code so can someone please help. All I want to do is echo the number of rows in a table. Here is the code <?php $qCheckFirstLog = "SELECT * FROM logindetails WHERE email = '".$_SESSION['email']."'"; $rCheckFirstLog = mysql_query($qCheckFirstLog); $num_rows = mysql_num_rows($rCheckFirstLog); ?> Now there are 15 records with the session emails name in the table. I know the session email is there as it echos an email if I ask it too so thats not missing but when I put <?php echo $num_rows; ?> I get nothing!!!!!! Can someone please tell me what I'm doing wrong Thank you Quote Link to comment https://forums.phpfreaks.com/topic/221789-num_rows/ Share on other sites More sharing options...
MatthewJ Posted December 15, 2010 Share Posted December 15, 2010 $rCheckFirstLog = mysql_query($qCheckFirstLog) or die (mysql_error()); Try that, most obvious thing would be that the query is failing. Quote Link to comment https://forums.phpfreaks.com/topic/221789-num_rows/#findComment-1147819 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.