Strange problem
Hi, I have a database made with appery.
In that database, I store information like :
userID,photo,commentaire.
The photo is a base 64 encoded image.
In my app, I take picture that are stored in that database.
Now, I have to make a copy of these pictures on another system.
So I've made a PHP page that perform a GET on the appery database like that:
code
$url = "https://api.appery.io/rest/1/db/collections/photo"
$headers = array(
"Content-Type: application/json",
"X-Appery-Database-Id: myId"
);
$handle = curl_init();
curl_setopt($handle, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt($handle, CURLOPT_URL, $url . "?where". urlencode($data_string));
//echo("?where". urlencode($data_string));
//curl_setopt($handle, CURLOPT_URL, $url);
curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);
curl_setopt($handle, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);
$data = curl_exec($handle);
curl_close($handle);
//print_r($data);
$array = json_decode($data);
// then I parse my array to extract the image and save them on the other server
/code
For quite all my picture, it works fine , but for some, I have this error (we can see here the end of the photo then some fields following, and particulary the field "commentaire"). At the end, we see the error.
....P86jQHGS5G30GMirMQ3owYKrHpjIP40wuQsJGKnylViOhbOfpUhk2q+4An+HByPpUZLkk5fHQDbkEVEkmzLEZI7dqBBeKskRQqShHOR3rn0VwCOBt985FbjS+YpBjIZjkEHj6VSlhctvBLdjxnNNICjvxgEn+lPUE/Nnj3p7xqGKsQCO2KaiYJG4CgQnbNIWwQAcjFPA+cjPI96SRMHPA9aaA//Z [commentaire] = Mur vers l intérieur [idElement] = 35 [piscineComplete] = [acl] = stdClass Object ( [*] = stdClass Object ( [write] = 1 [read] = 1 ) ) [createdAt] = 2015-07-29 18:55:53.985 [updatedAt] = 2015-07-30 21:14:13.370 ) )
Erreur
Undefined property: stdClass::$commentaire
So I'm quite lost, it works fine for quite all my pictures but for some, it don't and I have this error. Does someone have an idea ?
Thanks
Sylvain