[FX.php List] Returning a search with multiple entries

Andrew Denman adenman at tmea.org
Mon Aug 21 14:25:37 MDT 2006


I use a variable to keep track if I've added a search parameter before I
submit the find to FileMaker.  If no other search parameters are submitted I
search Last_Name for "", which returns no records.  Using a different
default is also possible; you just need to change the last if statement to
account for it.

 

Code:

// Find the records we want

// Keep track if we add a search, to determine if we should

// add a default search so no records are returned

$paramAdded = false;

if($first_name != ""){$Lookup->AddDBParam("First_Name", '"'.$first_name.'"',
$first_name_op); $paramAdded=true;}

if($school != ""){$Lookup->AddDBParam("School", '"'.$school.'"',
$school_op); $paramAdded=true;}

if($city != ""){$Lookup->AddDBParam("School_City", '"'.$city.'"', $city_op);
$paramAdded=true;}

if($last_name != "" || !$paramAdded){$Lookup->AddDBParam("Last_Name",
'"'.$last_name.'"', $last_name_op);}

 

 

Andrew Denman



  _____  

From: fx.php_list-bounces at mail.iviking.org
[mailto:fx.php_list-bounces at mail.iviking.org] On Behalf Of
FHASELTINE at aol.com
Sent: Sunday, August 20, 2006 10:27 AM
To: fx.php_list at mail.iviking.org
Subject: [FX.php List] Returning a search with multiple entries

 

I am able to have a search with multiple selection criteria and the proper
records are returned.

If a search is done - I am able to code the targeted page so that a single
search item needs to be entered - for example a posted field "LastName" and
that would be OK if only one field was searchable.

My search is designed with five search elements, now any of my fields can be
entered. Examples are: "LastName" or "State" etc.

I so not have any restrictive coding so when nothing is entered, all records
are returned.

My problem is that I want at least one of my five $Field = $_POST['Fields']
to be filled in and have a value.  

Any entry would do.
Any suggestions?

Thanks

Florence  Haseltine
AIM: Fhaseltine
fhaseltine at aol.com
240-476-7837



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.iviking.org/pipermail/fx.php_list/attachments/20060821/78681fca/attachment-0001.html


More information about the FX.php_List mailing list