Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Fatal error: Cannot use object of type FX_Error as array

Featured Replies

Im trying to create a link from one page to another that passes a Member ID value as follows:

http://acwa2djszbbyvu.devcloud.acquia-sites.com/Pages/acwaBoardBallotPaper2015.php?username=100000

But Im getting: Fatal error: Cannot use object of type FX_Error as array in /mnt/gfs/acwa2djszbbyvu/sites/default/files/subsites/Pages/acwaBoardBallotPaper2015.php on line 47

The PHP in the destination page is as follows:

<?php

//session_start();

include_once('FX/FX.php'); 
include_once('FX/server_data.php');

ini_set('display_errors', 1);
//var_dump($ballotData);
error_reporting(E_ALL);
//exit();
//ini_set('display_errors', 'On');
//print_r($errors);
//define('DEBUG', true);
//echo 'Hallo World';
//print_r($_POST);

/*
 * cb_checked
 * Checks to see if the value validates against a previously checked option
 *
 * @param string $value
 * @return boolean
 */
function cb_checked($value)
{
    $return = (false !== strpos(strtolower($value), 'Yes')) ? ' checked="checked"' : '';
    return $return;
}
function rb_checked($value, $check)
{
    $return = (false !== strpos(strtolower($value), $check)) ? ' checked="checked"' : '';
    return $return;
}

$username = $_REQUEST['username'];

$groupSize='1';

$ballot=new FX($serverIP, $webCompanionPort, $dataSourceType);
$ballot->SetDBData('Membership_on_Web','Voting_Online');
$ballot->SetDBPassword('$webPW','$webUN');

$ballot->AddDBParam('Member_ID', $username, 'eq');

$ballotResult=$ballot->FMFind(); 
$returnedCount=$ballotResult['foundCount'];    //THIS IS LINE 47
echo $ballotResult['errorCode']; 
foreach($ballotResult['data'] as $key=>$ballotData);
$ballotData = current($ballotResult['data']);

if($returnedCount != 1){
    exit("Membership could not be validated.\n");    
}

$searchVariable=explode('.',$key); 
$currentRecord=$searchVariable[0];

 

//etc.

?>
What am I doing wrong? I know passing values in URLs is not best practice but I just want to get the page to load any old how per the time being.

Straight after the FMFind, insert the following to check what the underlying error is:

		if (FX::isError($ballotResult)) {
			echo $ballotResult->getMessage();
			echo "<br />";
			var_dump($ballotResult);
		}

 

  • Author

Thanks Webko. Not sure how to proceed with errors.

 

 

 

 

 

 

Edited by brainonastick

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.