June 30, 20169 yr 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.
June 30, 20169 yr 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); }
June 30, 20169 yr Author Thanks Webko. Not sure how to proceed with errors. Edited July 1, 20169 yr by brainonastick
Create an account or sign in to comment