Total number of people: I hope one of you can help with this: The script I use on my website www.zerious.dk under "Genealogy" - "Name Lookup - test". It is used to search for people in my MySql database with a specific name, you can search by either first or last name - or parts of it - and it works fine. But it would be nice if it was possible also to get to know how many people are found by a search. Now the question is whether it is possible to put into my script so I also have found the number of people with the given name?
This is the script code:
<?php
if(isset($_POST['submit']))
{
$query = $_POST['query'];
$min_length = 1;
if(strlen($query) >= $min_length)
{
$query = htmlspecialchars($query);
$query = mysql_real_escape_string($query);
$raw_results =
mysql_query("SELECT * FROM person_st WHERE (`efternavn` LIKE '%".$query."%') OR (`fornavn` LIKE '%".$query."%')");
echo "<table border='0' width='500' align='center' cellpadding='1' cellspacing='1'>";
if(mysql_num_rows($raw_results) > 0)
{ while($results = mysql_fetch_array($raw_results))
{ echo "<tr><td width='125px'>".$results['efternavn']."/td>td>".$results['fornavn']." </td></tr>" ; }}
else{ echo "<tr><td colspan='2' height='20px'>Din søgning gav intet resultat! </td></tr>";
echo "</table>"; }}
else{ echo "Nej, den går ikke, du kan ikke søge på ingenting - skriv mindst $min_length bogstav!"; }}
?>