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

Erik Andreas Cayré erik at cayre.dk
Sat Aug 19 06:42:44 MDT 2006


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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 1856 bytes
Desc: not available
Url : http://www.iviking.org/pipermail/fx.php_list/attachments/20060819/031efe58/smime.bin


More information about the FX.php_List mailing list