I am trying to count the number of records in my table.
I have this code:
<?php
$link_id=mysql_connect("localhost","user","password");
mysql_select_db("database",$link_id);
if (mysql_select_db("database",$link_id)) echo "Connected to the database...
";
else die ("Connection failed.");
$sql="select count(*) as field from table";
echo $row["field"];
?>
Can someone please give the correct code to get this right.
Regards.