1, the Controller debugging:
Halt (' xxx ')//display content, terminate program
2, model debugging (is the current database operation class in the execution of the SQL statement)
$US = M ();
$US->find (1);
echo $US->getlastsql ();
Show Page trace Information
' Show_page_trace ' =>true,
Modification of template substitution variables
' Tmpl_parse_string ' => Array (
' __public__ ' => './public ',
' __attachs__ ' => './attachments/content ',
),
' Log_record ' =>true,//turned on logging.
' Log_record_level ' =>array (' Emerg ', ' ALERT ', ' ERR '),
thinkphp Database
Master-slave database "high concurrency, high load"
One
Database deployment mode: 0 Centralized (single server), 1 distributed (Master-slave server)
' Db_deploy_type ' => 0,
Second, the database information synchronization
Three
' Db_host ' => ' localhost ',//server address
Four
' Db_master_num ' => 1,//read/write separated rear server number
Instantiation model
Four methods:
Because when we name the Think_user thinkphp will be according to the case to distinguish whether you are preceded by an _ underline
Think_user_message can M (' user_message ');
1, New model (' User ');
2,
Traditional use of SQL statement methods
$US = M ();
$list = $US->query (' select * from Think_user ');
Cross-trousers operation
Protected $dbName = ' user ';
Curd manipulation
Find (), select (), FindAll ()
Multiple tables
Indicates that to table prefix array form
Table (Array (' Think_us ' => ' a ', ' think_ok ' => ' mm '))
String form
' Think_us a,think_ok mm '