Jump to content

[SOLVED] won't count contents


dadamssg

Recommended Posts

im trying to display the number of new messages next to an Inbox link....heres my code

$me = $_SESSION['logname'];

$cxn = mysqli_connect($host,$user,$passwd,$dbname) or die("Couldn't connect"); 
     $sql = "SELECT * FROM Messages 
                    WHERE sentto = '$me' AND status='0'";  
     $result = mysqli_query($cxn,$sql)
               or die("Couldn't execute select query.");
 		   
     $count = mysqli_num_rows($result); 

 

and then i attempt to echo $count but its not outputting anything. the query works in phpmyadmin

 

Link to comment
https://forums.phpfreaks.com/topic/159444-solved-wont-count-contents/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.