How to view the SQL statements executed by Android back to Php-server (based on Discuz interface) parameters
The project configuration is described as follows:
Server-side: discuz, debugging a server-side interface to Android (to receive requests sent from Android)
Client: Android4.4
The problem flow is described as follows:
After posting on the forum, the Android side uses the HttpPost package parameter to send the relevant URL to the PHP side via the httpclient, and performs the relevant SQL operation on the PHP side by mysql_query returning True or false to the Android side.
The problem is described as follows:
Now on the Android side get post returned result is {"result": "Post Failed"}, (ˇ?ˇ) thought might be PHP side in the execution of SQL operation error, want to see the PHP side executed SQL statement. Because my PHP interface is based on Discuz, if the interface is deployed through Zend Studio to Apache Htdocs, I have tried, did not deploy successfully, unable to receive the parameters sent by the Android side
Would like to ask you,
1) Is it possible to deploy this interface to Apache to receive data from Android (win7,apache,mysql,php5.25,zend Studio 10.0)
2) If not, how to debug the Android side to send to the PHP server parameters; Now I want to look at the SQL statements that are executed after being passed back to the PHP server.
Thank you all first.
------Solution--------------------
This problem happened to me too, the solution is as follows
Find: \source\class\discuz\discuz_error.php, and open
Search: Show_error ($type, $errormsg, $phpmsg = ", $typemsg =")
Under the Show_error function, use the File_put_contents function to print the $errormsg into a txt
public static function Show_error ($type, $errormsg, $phpmsg = ", $typemsg =") {
Global $_g;
File_put_contents (Discuz_root. /appapi/log.txt ', $errormsg. Php_eol,file_append);
Ob_end_clean ();
$gzip = Getglobal (' gzipcompress ');
Ob_start ($gzip? ' Ob_gzhandler ': null);
The back is not copied ...
}
The disadvantage is that all discuz SQL errors will be recorded in, of course, the general discuz of the SQL error is still very small
------Solution--------------------
If you want to combine with Discuz's data and reduce development time, it is recommended that you use Discuz's existing DB classes and methods
I don't know where Zend is. sql, but execute SQL error, you can use Mysql_error () to get error information, with file_put_contents output to a txt inside
------Solution--------------------
Light up the relevant code for your interface.
No code how to solve the problem ...
------Solution--------------------
This need to see your interface, can you manually debug?
If you can, you just need to care about the parameters of the transfer
------Solution--------------------
A system like yours that is packaged with data needs to be debugged by separating the client from the server.