November 5, 200520 yr re: $view_detail = $_POST['view_detail']; view_detail is an Array. So you may need to extract the elements and use an "or" in the search. Good Luck. Garry
November 8, 200520 yr Author Hi Gary, Thank you for the help. I am not clear what you meaning about use an "or" in the search. PHP2005
November 8, 200520 yr I'm not sure where the $value variable is coming from: <?php echo ''.$value; ?> The "OR" would be added like this: $findrecord->AddDBParam("-lop","or"); It indicates to FM to find any of the values in the view_detail list. You still have to convert the view_detail Array to a list. Do you have a view_detail field in your database? If so, what type of data does it contain? That is, what are you searching for? Maybe you should be searching for RecordIDs. All the best. Garry
November 9, 200520 yr A couple of things Index.php In the form I see no 'info_ID' defined show_all.php You cannot POST an array (believe me I tried). So your view_detail that you are posting needs to be broken into a list: Input name=viewdetail1 input name=viewdetail2 title_detail_list.php Your POST data would need to correspond to what you are submitting for show_all.php One great way to get all the $_REQUEST values from the array into variables is the following script I picked up: foreach($_REQUEST as $key=>$value) { $$key=$value; } it may help. As Gary says Good Luck!
November 9, 200520 yr Author Hi Garry, Thank you for the help. The value of <?php echo ''.$value; ?>are comming from a simple database. I did try to search using theRecordIDs, but it is bringing me the entire records instead bring me only the ones I had checked on search_all.php to be displayed on title_detail_list.php. I am not sure what I am missing. I am attaching the zip file to see if you can give me an idea what am I missing. thank you! : search.zip
November 10, 200520 yr In the "show_all.php" page change the chaeckbox to look like this: In the "title_detail_list.php" page have this: if(isset($_GET['Info_ID'])) { $Info_ID = $_GET['Info_ID'];}; if(isset($_POST['view_detail'])) { $Info_ID = implode(" ",$_POST['view_detail']);}; $findrecord=new FX($serverIP,$webCompanionPort); $findrecord->SetDBData('file.fp7','Main'); $findrecord->SetDBPassword('monkey','admin'); $findrecord->AddDBParam("Info_ID",$Info_ID); $findrecord->AddDBParam("-lop","or"); $findrecordResult=$findrecord->FMFind(); Working fine : All the best. Garry
November 10, 200520 yr Author Hi Garry, I did try the code, but for some reason when I check more than 1 checkboxes on search_all.php page, I keep getting the following error on title_detail_list.php page: Found Count = -1 Error Code = 401 But if I check only 1 checkbox, it works fine. Do you have any idea why I keep getting the error message? Thank You
November 10, 200520 yr Did you include the [] square brackets with the checkbox name: view_detail[] Is the "or" correct. You can test manually with: $findrecord=new FX($serverIP,$webCompanionPort); $findrecord->SetDBData('file.fp7','Main'); $findrecord->SetDBPassword('monkey','admin'); $findrecord->AddDBParam("Info_ID","S103 S104 S105"); $findrecord->AddDBParam("-lop","or"); This list ("S103 S104 S105") is being created by the implode() function from the view_details[] array. Good Luck. Garry
Create an account or sign in to comment