O.k there is one last thing that is bugging me about databases and that is doing a simple count of records. I have setup up a test databse with names, these are selected using a drop down menu on the form. The results are passed over to this page.
I want to able to show how many entries there are of the same name example: The are (2) entries with the name john.
I have included the top part of my code. I have tried and tried to get a count and nothing seems to work. I have put down my original code, would someone be kind enough to show me what needs to be added.
<?
include("dbinfo.inc.php");
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query="SELECT * FROM test WHERE names='$names order by rand()";
$result=mysql_query($query);
$num=mysql_numrows($result);
mysql_close();
?>