Good morning,
I'm working with the checkout service of Cielo
and I'm having a problem at the time of processing the url
return, that is, the file is called when there is an update in the payment, soon I never directly access the file, it is called through url
by own Cielo
.
The problem is that I am not able to run some sql
codes and I also can not debug them.
When I just check the incoming file I use this code:
$data = $_POST;
$filename = microtime(true);
$fp = fopen($filename.'.json', 'w');
fwrite($fp, json_encode($data));
fclose($fp);
This generates a file with all data correctly. But when I try something like this:
require_once('server.php'); //Aqui está a conexão com o banco e funções de query
$query = sql('SELECT * FROM ...');
$filename = microtime(true);
$fp = fopen($filename.'.json', 'w');
fwrite($fp, json_encode($query));
fclose($fp);
No files are written to the server, so I can not see what's happening.
How can I get around this?