March 3, 200421 yr Hi there, i just want to ask how can i create a multiple(And/Or) find request by using PHP FX. For example the find request , A and B or C. It is very easy to do it in Filemaker, but in PHP with using FX, i only can perform one type, either all "And" or all "Or", eg. A and B and C / A or B or C Hope someone can help me. Thanks for helping. Regards, Henry
March 3, 200421 yr Hi Henry, you can't do this directly in a single call to FileMaker; Web Companion simply doesn't support it. However, using PHP and FX there is an excellent alternative - make two separate calls to the database, store the results from each separately, then merge the data portions of the results using PHP's merge_array() function. Here is an example: <? require_once("FX/FX.php"); $query = new FX("127.0.0.1", "591"); // Search in Book_List.fp5 // $query->SetDBData("Book_List.fp5", "Detail_View"); $query->AddDBParam("author", "bowers"); $result_1 = $query->FMFind(); // Search in Book_List_part_2.fp5 // $query->SetDBData("Book_List_part_2.fp5", "Detail_View"); $query->AddDBParam("author", "bowers"); $result_2 = $query->FMFind(); // Merge the results // $result_1["data"] = array_merge($result_1["data"], $result_2["data"]); // Output the results // print "<table border=1 cellpadding=1 cellspacing=1>n"; foreach ($result_1["data"] as $row) { print "<tr><td>".$row["author"][0]."</td><td>".$row["title"][0]."</td></tr>n"; } print "</table>n"; ?>
Create an account or sign in to comment