I am a rookie who has just entered the new profession.
Now use the thinkphp development side.
Now what I know is getlastsql () and alert () to troubleshoot the problem,
Is there any other method that can be tested?
Reply content:
I am a rookie who has just entered the new profession.
Now use the thinkphp development side.
Now what I know is getlastsql () and alert () to troubleshoot the problem,
Is there any other method that can be tested?
The development process either uses the phone to debug the test directly or use the official web Developer tool for debugging testing. To do development is more than the usual interface, PC pages, footsteps or something troublesome
To PC as the King of the era, we develop the Web, debugging is very simple and convenient, the most used is the Google development artifact, Chrome-devtools, in Google Chrome, F12 directly open Chrome-devtools can be directly developed debugging.
That's when our cell phone is king, our eyes are shifted from the computer to the big phone. In the development of web apps, of course, debugging AH. Usually when we develop the Web app, in the function, interface development, can be developed on the PC first, and so on, and finally go to the phone test debugging.
Last time I wrote an article, you can see, usually I often use this debugging.
Http://lanchenglv.com/article ...
Test, TP Debug tool should have a lot of it? In addition to the app after the use of trace and other functions to track the flow of what, anyway, it should be very convenient is AH. I remember that TP5 also seemed to support Test unit testing (no use ...).
Also, is your alert not something that →_→ browser uses? It is recommended to use Console.log to output debugging,
Console.error What the output error is.
(studied TP for a while ...) Oneself also follow the idea of TP wrote a frame, atd_mini oneself use also handy. )
Can see Socketlog, should be helpful
TP now has this remote debugging tool, for the API, Ajax debugging is particularly useful, you can integrate it into your TP framework Socketlog
我下面这个方法,主要是哪里想打印,就直接存数据库,主要是方便异步,或者在不打断情况下,实现想看到的数据
"; var_dump($data); die();}/** * 调试(插入一条记录) */function TS($content) { if (!$content) { $content = '空信息!!!'; } $add_time = date('Y-m-d H:i:s', NOW_TIME); if (is_array($content)) { $content = var_export($content, true); } M('ts')->add(array('content' => $content, 'add_time' => $add_time));}/** * 调试(插入一条SQL语句) */function TSSQL($model) { TS(M($model)->getLastsql());}表结构CREATE TABLE `wp_ts` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `content` text, `add_time` varchar(100) DEFAULT '' COMMENT '时间', PRIMARY KEY (`id`));