Am trying to count how many rows have a particular word in database using php. and when i use this code below to do it, it only returns (1) even when there are more than 1
$sql="SELECT COUNT(*) FROM user_contact_us where status='unread'";
$result=mysqli_query($conn,$sql);
$numR=mysqli_num_rows($result);
echo $numR;
I also did it like this
$sqlr = $conn->query("SELECT COUNT(*) FROM user_contact_us where status='read'");
$numR = $sqlr->num_rows;
echo $numR;
and it keeps returning 1 as the value when its supposed to be 2 or 3. Please how do i fix this