Thanks for the replies :)
Victor's suggestion put me on the right track. (I still have trouble with
language constructs)
Heres what I have now.. All I need to do is name my form fields with the
same name as the column names from the mysql table, and presto! now I can
just add/remove from the search form without changing the code. (I hope.. It
has worked so far).
while (list ($key, $val) = each ($HTTP_POST_VARS))
{
if (!is_int($key) && $key!="Submit" && $key!="submit" &&
$key!="offset")
{
if (!empty($val))
{
if (!empty($whereclause))
{
if($key=="Price")
{
$whereclause.=" AND Price$val";
}else{
$whereclause.=" AND $key='$val'";
}
}
else
{
if($key=="Price")
{
$whereclause.=" Price$val";
}else{
$whereclause.=" $key='$val'";
}
}
}
}
}
Thnaks
JD
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]