Outputting from getalbum...
elyobelyob
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.
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.
0
Comments
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
SmugMug API Developer
My Photos
Thanks