I have written/modified a script that searches a table for a name that user wants to look for. it works. the problem I am having is if there are multiple names that are the same it will only return the first one it finds. what do I need to do to have the script keep searching? here is what I have so far:


@mysql_select_db("$database") or die( "Unable to select database");

/*Search database for name*/
$query="SELECT name,position,extention,phone from employees where name like '%$searchtext%'";



/*Display Results*/


if ($num == 0) {
echo "I'm sorry. There were no matches for that name.";

else {

$name = mysql_result($result,0,"name");

echo "<tr bgcolor=\"c2ccff\"><td align=middle><b>$name</b></td><td align=middle><b>$position</b></td>";
echo "<td align=middle><b>$ext</b></td><td align=middle><b>$phone</b>";
echo "</td></tr></table>";