Well if I am understanding you correctly, for each search criteria they specify, you will compare it to the corresponding column in the database and if a given row in the result set matches all selelected criteria, you will display it.

If that is the case, al you should need is something like this for each entry:
<?
$displayrow = true;
while(list($key,$val) = each($_POST)){
//check each submitted value in the $_POST array
$displayrow = $displayrow && ($db_objects[$i]->$key == $val)
//if it equals the value for that row, $displayrow will continue to be true
}
if($displayrow){
...
}


?>

here's where it goes in the code:

<?
$filename = XML_REPOSITORY . "db.xml";
$object_def = extractObjectDef( $filename );
$db_objects = readFromXML( $filename, $object_def[0], $object_def[1] );
$size = count( $db_objects );

for ($i = 0; $i < $size; ++$i )
{
if ( $db_objects[$i] != null )
{
$displayrow = true;
while(list($key,$val) = each($_POST)){
$displayrow = $displayrow && ($db_objects[$i]->$key == $val)
}
if($displayrow)
{
echo $db_objects[$i]->id . ", " . $db_objects[$i]->lastname . ", " . $db_objects[$i]->firstname . ", " . $db_objects[$i]->title . ", " . $db_objects[$i]->ext . ", " . $db_objects[$i]->directline . ", " . $db_objects[$i]->department . ", " . $db_objects[$i]->manager . ", " . $db_objects[$i]->team . "<br />";
}
}
}


?>

Jon

_________________________________________________________________
Enjoy MSN 8 patented spam control and more with MSN 8 Dial-up Internet Service. Try it FREE for one month! http://join.msn.com/?page=dept/dialup



____________________
BYU Unix Users Group http://uug.byu.edu/ ___________________________________________________________________
List Info: http://uug.byu.edu/cgi-bin/mailman/listinfo/uug-list

Reply via email to