Hello,

I want to expand my search site. I want to 2 selection option fields in it. Can anyone of you
explain me how to include $fach and $name into my search routine. My brain is very clean for
the moment. Thanks in advance

here is my script:

$searchfach = $fach; // first variable with selection option field
$searchname = $name; // second variable with selection option field
// key variable is a input field
if ($p) {$actualpos = $p;}
$where="";
$key = strtolower($key);
$key = ereg_replace("+"," ",$key);
$key = ereg_replace(""","",$key);
$key = ereg_replace(" and "," ",$key);
$key = ereg_replace(" or "," ",$key);
echo "key = $key";
if ($key != ""): $kiki=0; endif;
if ($key != " "): $kiki=0; endif;

if ($kiki == 0):
$tok = strtok($key," ");

while ($tok):
$help = $tok;
if ($where != ""): $where = $where . " OR "; endif;
$where = $where . " ort like '%" . $help . "%'";
$where = $where . " OR fach1 like '%" . $help . "%'";
$where = $where . " OR vorname like '%" . $help . "%'";
$where = $where . " OR nachname like '%" . $help . "%'";

$tok = strtok (" ");
endwhile;
endif;


if ($where != ""):
$k=1; $checker = 1; $showpos = 0;
$result = mysql_query("SELECT vorname,strasse,ort,plz,nachname,fach1,title,telefon FROM arzt WHERE $where ORDER BY vorname");
$num = mysql_num_rows($result);