I am trying to figure out why the num_rows
always return 1
? I searched high and low to find out what I am doing wrong here. Any help would be grateful! In my query where I have status = ''
that should find the rows where status
is NULL
correct? If so then the count should be 2
.
$query = "SELECT * FROM referrals WHERE (status = 'W' OR status = '') AND referral_id = '".$thisId."'";
$result = $mysqli->query($query);
$TotalRcount = $result->num_rows;
while($row=$result->fetch_assoc()){
//read columns
}
$inprogress = $TotalRcount;
echo $TotalRcount; // Always returning 1