WingMaker Posted October 27, 2009 Posted October 27, 2009 Hi All, How can insert an array into a field? Is this possible? Or if not, How can I insert the array's data into the filemaker field? thanks RB
Genx Posted November 17, 2009 Posted November 17, 2009 Hi WingMaker, 1) Depends on the complexity of the array. 2) Depends if you want it to be human readable or are just using it for storage purposes. If you just wanted to store the array values for example to be used again later: 1) To Store $array = array("Item 1","Item 2","Item 3"); $storeArray = implode("n",$array); . . . $myEditCmd->setField('array',$storeArray); $myExitCmd->execute(); 2) To Retrieve $storeArray = $record->getField('array'); $array = explode("n",$storeArray); If you had a more complicated array and wanted to store it and retrieve it the easiest way would be as follows: $array = array( 51255=>array("FirstName"=>"Alex","LastName"=>"Babkov","CallSign"=>"Alex Babkov"), 99124=>array("FirstName"=>"Bob","LastName"=>"Hawke","CallSign"=>"Primey") ); $storeArray = base64_encode(serialize($array)); And to retrieve: $storeArray = $record->getField('array'); $array = unserialize(base64_decode($storeArray));
Recommended Posts
This topic is 5742 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