Link to home
Start Free TrialLog in
Avatar of owlsey
owlsey

asked on

syntax q

if i have a class with the following function: require_once ('Filemaker.php');
$fm = new FileMaker(''db, 'ip', 'usr', 'pwd');
$request = $fm->newFindCommand('ResidentialRentalsListings','layout');
$result = $request->execute();
$records = $result->getRecords(); //<- gives err

heres the class
   function &getRecords()
    {
        return $this->_impl->getRecords();
    }

    /**
     * Return a list of the names of all fields in the records that
     * are part of this response. Just the names are returned; if
     * additional information is required then Layout object provided
     * by getLayout() must be consulted.
     *
     * @return array String field names.
     */

what effect does the ampersand have on this function?
Avatar of setec
setec

The ampersand means the return by reference: http://www.php.net/manual/en/functions.returning-values.php

Which error do you get?
Are you sure that $request->execute(); returns a valid object?

Sincerely,
Setec Astronomy
Avatar of owlsey

ASKER

Hi-

thanks for your response.

I guess it returns a valid object; how would you tell, usa a print function??

thnx,
duncan
You can use print_r(), var_dump() or var_export() to check if it works correctly.

Sincerely,
Setec Astronomy
Avatar of owlsey

ASKER

FileMaker_Error Object ( [_fm] => FileMaker_Implementation Object ( [V73ee434e] => Array ( [charset] => utf-8 [locale] => en [logLevel] => 3 [hostspec] => ip [username] => usr [password] => pwd [database] => db [recordClass] => FileMaker_Record [prevalidate] => ) [Vea4b3413] => [Vff1d7746] => [V9a3dcbce] => -25625993 ) [error_message_prefix] => [mode] => 1 [level] => 1024 [code] => [message] => Communication Error: (22) The requested URL returned error: 404 [userinfo] => [backtrace] => Array ( [0] => Array ( [file] => /www/dd/DEV/FileMaker/Error.php [line] => 50 [function] => PEAR_Error [class] => PEAR_Error [object] => FileMaker_Error Object *RECURSION* [type] => -> [args] => Array ( [0] => Communication Error: (22) The requested URL returned error: 404 [1] => ) ) [1] => Array ( [file] => /www/dd/DEV/FileMaker/Implementation/FileMakerImpl.php [line] => 99 [function] => FileMaker_Error [class] => FileMaker_Error [object] => FileMaker_Error Object *RECURSION* [type] => -> [args] => Array ( [0] => FileMaker_Implementation Object ( [V73ee434e] => Array ( [charset] => utf-8 [locale] => en [logLevel] => 3 [hostspec] => ip [username] => usr [password] => pwd [database] => db [recordClass] => FileMaker_Record [prevalidate] => ) [Vea4b3413] => [Vff1d7746] => [V9a3dcbce] => -25625993 ) [1] => Communication Error: (22) The requested URL returned error: 404 ) ) [2] => Array ( [file] => /www/dd/DEV/FileMaker/Implementation/Command/FindImpl.php [line] => 24 [function] => _execute [class] => FileMaker_Implementation [object] => FileMaker_Implementation Object ( [V73ee434e] => Array ( [charset] => utf-8 [locale] => en [logLevel] => 3 [hostspec] => ip [username] => usr [password] => pwd [database] => db [recordClass] => FileMaker_Record [prevalidate] => ) [Vea4b3413] => [Vff1d7746] => [V9a3dcbce] => -25625993 ) [type] => -> [args] => Array ( [0] => Array ( [-db] => db [-lay] =>layout [-findall] => 1 ) ) ) [3] => Array ( [file] => /www/linnaeusgroup/DEV/FileMaker/Command.php [line] => 125 [function] => execute [class] => FileMaker_Command_Find_Implementation [object] => FileMaker_Command_Find_Implementation Object ( [_findCriteria] => Array ( ) [Vd65662c5] => Array ( ) [Va9136a07] => Array ( ) [Vf951bdce] => [V83f28691] => [V85fd701e] => [_fm] => FileMaker_Implementation Object ( [V73ee434e] => Array ( [charset] => utf-8 [locale] => en [logLevel] => 3 [hostspec] => ip [username] => usr [password] => pwd [database] => db [recordClass] => FileMaker_Record [prevalidate] => ) [Vea4b3413] => [Vff1d7746] => [V9a3dcbce] => -25625993 ) [_layout] => ResidentialRentalsListings [V7a2db0ea] => [_script] => [_scriptParams] => [_preReqScript] => [_preReqScriptParams] => [_preSortScript] => [_preSortScriptParams] => [V0b9a204c] => FileMaker_Record [_recordId] => ) [type] => -> [args] => Array ( ) ) [4] => Array ( [file] => /www/dd/DEV/testr.php [line] => 7 [function] => execute [class] => FileMaker_Command [object] => FileMaker_Command_Find Object ( [_impl] => FileMaker_Command_Find_Implementation Object ( [_findCriteria] => Array ( ) [Vd65662c5] => Array ( ) [Va9136a07] => Array ( ) [Vf951bdce] => [V83f28691] => [V85fd701e] => [_fm] => FileMaker_Implementation Object ( [V73ee434e] => Array ( [charset] => utf-8 [locale] => en [logLevel] => 3 [hostspec] => ip [username] => blah [password] => blah [database] => blah [recordClass] => FileMaker_Record [prevalidate] => ) [Vea4b3413] => [Vff1d7746] => [V9a3dcbce] => -25625993 ) [_layout] => ResidentialRentalsListings [V7a2db0ea] => [_script] => [_scriptParams] => [_preReqScript] => [_preReqScriptParams] => [_preSortScript] => [_preSortScriptParams] => [V0b9a204c] => FileMaker_Record [_recordId] => ) ) [type] => -> [args] => Array ( ) ) ) [callback] => )
Fatal error: Call to undefined method FileMaker_Error::getRecords() in /www/dd/DEV/testr.php on line 9
ASKER CERTIFIED SOLUTION
Avatar of setec
setec

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of owlsey

ASKER

had an issue with the db so i couldnt develop- im still unable to answer my q- but you can delete, split, etc- ill post another when the db gets back up