December 15, 200718 yr Alright, i've been trying many ways to do it and looked around on internet to see if i could find an answer about it. I only want to show(a freakin number) but sometime it brings me "Ressource ID #8" or not the right count... To be right i want to show(numeric) how many ppl are registered As i said, i tryed many way with SELECT COUNT(*) as 'Total' FROM users and never get the right count number. Thanks for help
December 15, 200718 yr hm.. that query looks like it should work. Could it be the quotes around "Total"? I've never used quotes for aliases. $query = "SELECT COUNT(*) FROM users"; $result = mysql_query($query) OR die(mysql_error()); if (mysql_num_rows($result)) { list($total) = mysql_fetch_array($result); echo "There is $total users."; } else { echo 'The query gave no results.'; } What does this snippet produce?
Create an account or sign in to comment