I am working on PHP where i want to fetch the count of a particular column 'uid' from users table. The output window is not displaying anything. following is the code. Can anybody, help me in rectifying this code.
<?php
$link = mysql_connect('localhost', 'username', 'password');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
mysql_select_db("rth_db");
$data = mysql_query("SELECT COUNT(uid) AS Total FROM users", $link);
$number = mysql_fetch_array($data);
echo $number;
echo 'Connected successfully';
mysql_close($link);
?>