Garry Claridge Posted November 5, 2005 Posted November 5, 2005 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
PHP2005 Posted November 8, 2005 Author Posted November 8, 2005 Hi Gary, Thank you for the help. I am not clear what you meaning about use an "or" in the search. PHP2005
Garry Claridge Posted November 8, 2005 Posted November 8, 2005 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
mlindal Posted November 9, 2005 Posted November 9, 2005 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!
PHP2005 Posted November 9, 2005 Author Posted November 9, 2005 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
Garry Claridge Posted November 9, 2005 Posted November 9, 2005 I need the login details for the database. Garry
PHP2005 Posted November 9, 2005 Author Posted November 9, 2005 Hi Garry, The Login is: Account Name: admin Password: monkey Thank You
Garry Claridge Posted November 10, 2005 Posted November 10, 2005 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
PHP2005 Posted November 10, 2005 Author Posted November 10, 2005 Hi Garry, Thank You, I will it try now. PHP
PHP2005 Posted November 10, 2005 Author Posted November 10, 2005 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
Garry Claridge Posted November 10, 2005 Posted November 10, 2005 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
Recommended Posts
This topic is 7341 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now