[FX.php List] FlattenInnerArray () doesn't work?

Dale Bengston dbengston at preservationstudio.com
Sun Aug 20 23:15:59 MDT 2006


I think FlattenInnerArray() is a feature that only works with FM7 or  
above.

Dale

On Aug 19, 2006, at 7:42 AM, Erik Andreas Cayré wrote:

> Using FX.php 4.2 against FMU6, I tried using the FlattenInnerArray  
> () parameter, but it didn't work.
> Instead I got it to work with the third parameter of FMFind set to  
> 'true'
>
> Why doesn't FlattenInnerArray () work as documented in the manual?  
> (Or is t just me?)
>
> Code:
>
> // Get data for selected period
> 	function getPeriod ($period, $keyacc = '', $salesrep = '')
> 	{
> 		global $dataServer;
> 		global $dataPort;
> 		global $dataType;
> 		global $DBPassword;
> 		global $DBUser;
> 		global $errorsList;
>
> 		
> 		$fx = new FX($dataServer, $dataPort, $dataType);
> 		$fx->SetDBData('Medarbejderliste.fp5', 'www-nogletal', 1);
> 		$fx->SetDBPassword($DBPassword);
>
> //		$fx->AddDBParam('dt_pref_nøgletal_sælger', $salesrep, 'eq');
> //		$fx->AddDBParam('dt_pref_nøgletal_keyacc', $keyacc, 'eq');
>
> 		$fx->AddDBParam('Initialer', 'bm');
>
> 		switch ($period)
> 		{
> 			case 'current':
> 				$fx->AddDBParam('-script', 'KNAP opdater noegletal denne maaned  
> [sub,www]');
> 				break;
> 			case 'next':
> 				$fx->AddDBParam('-script', 'KNAP opdater noegletal naeste  
> maaned [sub,www]');
> 				break;
> 			case 'longterm':
> 				$fx->AddDBParam('-script', 'KNAP opdater noegletal langsigtet  
> [sub,www]');
> 				break;
> 		}
>
> //		$fx->FlattenInnerArray(); //Does not currently work?!
>
> 		$return_data = $fx->FMFind(true, 'full', false);
> 		
> 		if ($return_data['errorCode'] == 0)
> 		{
> 			$fmData = array();
> 			foreach ($return_data['data'] as $records => $record)
> 			{
> 				foreach ($record as $field => $value)
> 				{
> 					$fmData[$field] = $value;	
> 				}
> 			}
> 			return ($fmData);
>
> 		}
> 		print '<pre>';
> 		print_r ($return_data);
> 		print '</pre>';
> 		return ('DBerror: ' . $errorsList[$return_data['errorCode']]);
> 	}
>
>
>
> ---
> Erik Andreas Cayré
> Spangsbjerg Møllevej 169
> DK-6705 Esbjerg Ø
>
> Home Tel: +45 75150512
> Mobile: +45 40161183
>
> »If you can't explain it simply, you don't understand it well enough.«
> -- Albert Einstein
>
> »If you don't have time to do it right, when will you have time to  
> do it over?«
> -- John Wooden, basketball coach
>
>
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list



More information about the FX.php_List mailing list