This will count result of rows returned from the query called $result and echo it straight to screen. Instead use the variable in a div to show the user amount of results from search. Use mysqli
1 2 3 4 5 6 7 8 9 10 11 12 |
$sql="SELECT id FROM workers"; if ($result=mysqli_query($mysqli,$sql)) { $rowcount=mysqli_num_rows($result); printf("Result set has %d rows.\n",$rowcount); mysqli_free_result($result); } |