Outputting from getalbum...

elyobelyobelyobelyob Registered Users Posts: 53 Big grins
I'm writing a first script using php & xmlrpc and have hit a brick wall. I've got the sessionid working and also the getalbums script working. However, I am trying to print out the results from getalbum and after three full days, I'm begging for some help.

My debug definitely shows data is coming out. However I have not managed to return the data correctly from the function ..

if (!$get_albums_response->faultCode()) {
$albums_array = xmlrpc_decode($get_albums_value);
$albums = array($albums_array,$albums_array);
return $albums;
}


Example of data in debug ...

---EVALING---[1210 chars]---
new xmlrpcval(array(new xmlrpcval(array('AlbumID' => new xmlrpcval(123456, 'int'),'Title' => new xmlrpcval("title"),'CategoryID' => new xmlrpcval(0, 'int'),'Category' => new xmlrpcval("Other")), 'struct'),new xmlrpcval(array('AlbumID' => new xmlrpcval(123456, 'int'),'Title' => new xmlrpcval("title2"),'CategoryID' => new xmlrpcval(20567, 'int'),'Category' => new xmlrpcval("NJB")), 'struct'),new xmlrpcval(array('AlbumID' => new xmlrpcval(123456, 'int'),'Title' => new xmlrpcval("Title3"),'CategoryID' => new xmlrpcval(0, 'int'),'Category' => new xmlrpcval("Other")), 'struct'),new xmlrpcval(array('AlbumID' => new xmlrpcval(123456, 'int'),'Title' => new xmlrpcval("title4"),'CategoryID' => new xmlrpcval(123456, 'int'),'Category' => new xmlrpcval("Title5")), 'struct'),new xmlrpcval(array('AlbumID' => new xmlrpcval(123456, 'int'),'Title' => new xmlrpcval("Title6"),'CategoryID' => new xmlrpcval(123456, 'int'),'Category' => new xmlrpcval("Title7")), 'struct'),new xmlrpcval(array('AlbumID' => new xmlrpcval(123456, 'int'),'Title' => new xmlrpcval("Title8"),'CategoryID' => new xmlrpcval(123456, 'int'),'Category' => new xmlrpcval("Title9")), 'struct')), 'array');
---END---


Any help sorely appreciated.

Comments

  • devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited May 11, 2005
    Nick,

    If u use the code below, do it print out the right values ? Trying to work out if it is accessing the info correctly or whether it's the way ur returning from the function.

    if (!$get_albums_response->faultCode()) {
    $albums_array = xmlrpc_decode($get_albums_value);
    $albums = array($albums_array,$albums_array);
    print $albums_array;
    print $albums_array;
    return $albums;
    }

    Cheers,

    David
    David Parry
    SmugMug API Developer
    My Photos
  • elyobelyobelyobelyob Registered Users Posts: 53 Big grins
    edited May 11, 2005
    devbobo wrote:
    Nick,

    If u use the code below, do it print out the right values ? Trying to work out if it is accessing the info correctly or whether it's the way ur returning from the function.

    print $albums_array;
    print $albums_array;
    It's the populating of the array within the function. i.e. after the xml_decode I am not getting any data into my fields. The print commands were empty.

    Thanks
Sign In or Register to comment.