So I have this function (below) and it is supposed to get the amount of users in a table that I have. I know there's 5 users and they all have an ID. However whenever I use the function to display it on a webpage it does not return a result.
This is the function
function user_count(){
mysql_connect("IP", "USER", "PASS");
mysql_select_db("db");
return mysql_query("SELECT * FROM users WHERE id>=0");
}
And this is the php for the website
<strong><span data-toggle="counter" data-to="
<?php
$users = user_count();
while ($row = mysql_fetch_array($users)){
echo $row['count'];
}
?>"></span></strong>