I would like to echo the number of people registered on my website
only the code that I have does not work, it gives me back that it can't be
converted to string. Also when I make it a function to call in my HTML I get error that $connection is undefined

```
require_once("connect.php");

$sql = "SELECT * FROM persons";
if ($result=mysqli_query($connection, $sql)){
$rowcount = mysqli_num_rows($result);
mysqli_free_result($result);
return $result;}

```

How do I get this in a function that I can call on my page that prints the number of people registered?