PDA

View Full Version : Outputting from getalbum...


elyobelyob
May-11-2005, 03:35 AM
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['AlbumID'],$albums_array['Title']);
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.

devbobo
May-11-2005, 05:19 AM
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['AlbumID'],$albums_array['Title']);
print $albums_array['AlbumID'];
print $albums_array['Title'];
return $albums;
}

Cheers,

David

elyobelyob
May-11-2005, 05:48 AM
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['AlbumID'];
print $albums_array['Title'];

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