thinkphp? ?? ?? PHP ????????. ??? ??, ??? ???, ???? ???? ??? ?????? ???? ?? ??? ????. thinkphp?? ???? ?? ???? ?? ??? ????? ? ??? ?? ??? ?? ?????? ???? ????. ???? thinkphp ?? ?????? ??? ???? ? ????? ??? ??? ?????.
?? ??? ??? ?? ???. thinkphp ?? ??????? ? ??? ???? ????. ? ??? ?????? ?? ???? ?????? ?? ?????? ?? ?? ???????, ?? ??? ??? ?? ?? ??????? ?????? ?????? ????. ????? ? ? ?? ?????? ??? ???? ?? ?????.
1. thinkphp ?????? ?? ???? ?? ?????
thinkphp ?????? ?? ???? ?? ?????? ?????? ?? ?????? ??? ?? thinkPHP/library/think ????? ?????. ??? ??? ???? ?? ??? ? ?? ?? ???? ?? ?????. ??? ????? ???? ?????? ?? ?? ?????? ?? ?????.
- ?????? ?? ??
thinkphp ?????? ?? ???? ?????? ?? ?? ?????? thinkPHP/library/think/db ????? ????. ??? ??? ??????? ??, ??, ??, ?? ?? ??? ?????, ???? ??? ??? ?? ???? ??????? ??? ? ????.
- ?? ?? ??
thinkphp ?????? ?? ???? ?? ?? ?? ?????? thinkPHP/library/think/cache ????? ????. ??? ??? ?? ?? ? ?? ??? ????? ???? ??? ??? ?? ???? ?? ??? ??? ? ????.
- ?? ?? ??
thinkphp ?????? ?? ???? ?? ?? ?? ?????? thinkPHP/library/think/file ????? ????. ??? ??? ?? ?? ? ?? ??? ????? ???? ??? ??? ?? ???? ?? ??? ??? ? ????.
- ??? ?? ??
thinkphp ?????? ?? ???? ??? ?? ?? ?????? thinkPHP/library/think/image ????? ????. ??? ??? ??? ???, ?? ??, ????? ?? ??? ??????. ???? ??? ??? ?? ???? ??? ??? ??? ? ????.
2. Thinkphp ?????? ??? ?? ?? ?????
thinkphp?? ???? ?? ??? ??? ???? ???????? ????? ??? ? ??? ??? ??? ????? ???? ??? ?? ????. ??? ?? ?????? ?? ???? ?????? ?????. ????? ??? ?? ?????? ??? ???? ???? ?? ?????.
?? ??, ?? ????? db.func.php? ??? ???? ?? ?????? ???? ??? common ????? ?????. ??? application/common/db.func.php???. ??? ??? ????.
<?php //連接數(shù)據(jù)庫(kù) function dbConnect(){ $db = new \Think\Db\Connection(config('DB_TYPE').':host='.config('DB_HOST').';dbname='.config('DB_NAME'), config('DB_USER'), config('DB_PWD')); return $db; } //查詢單條數(shù)據(jù) function dbFind($table, $where){ $db = dbConnect(); $result = $db->table($table)->where($where)->find(); ????return?$result; } //查詢多條數(shù)據(jù) function?dbSelect($table,?$where,?$order,?$limit){ ????$db?=?dbConnect(); ????$result?=?$db->table($table)->where($where)->order($order)->limit($limit)->select(); ????return?$result; } //插入數(shù)據(jù) function?dbInsert($table,?$data){ ????$db?=?dbConnect(); ????$result?=?$db->table($table)->insert($data); ????return?$result; } //更新數(shù)據(jù) function?dbUpdate($table,?$data,?$where){ ????$db?=?dbConnect(); ????$result?=?$db->table($table)->where($where)->update($data); ????return?$result; } //刪除數(shù)據(jù) function?dbDelete($table,?$where){ ????$db?=?dbConnect(); ????$result?=?$db->table($table)->where($where)->delete(); ????return?$result; } ?>
? ?? ?????? ??, ?? ??? ??, ?? ??? ??, ??? ??, ??? ???? ? ??? ??? ???? ? ?? ???? ??? ?? ??? ?????. ? ??? ?? ?? ?????? ???? ??? ?? ?????. ?? ?? ?? ??? ??? ???? ?? ?? db.func.php ??? ???? ???.
<?php require_once(APP_PATH.'/common/db.func.php'); //查詢單條數(shù)據(jù) $result = dbFind('user', 'id=1'); //查詢多條數(shù)據(jù) $result = dbSelect('user', 'id>0',?'id?desc',?'0,10'); //插入數(shù)據(jù) $data?=?array('name'=>'Tom','age'=>23,'sex'=>'男'); $result?=?dbInsert('user',?$data); //更新數(shù)據(jù) $data?=?array('name'=>'Jerry','age'=>24,'sex'=>'女'); $result?=?dbUpdate('user',?$data,?'id=1'); //刪除數(shù)據(jù) $result?=?dbDelete('user',?'id=1'); ?>
? ??? ? ? ??? , ??? ?? ?? ?????? ???? ??? ?? ????? ?? ???? ???? ? ????. ??? ??? ?? ?? ?????? ???? ?? thinkphp ??? ???? ?????.
? ???? thinkphp ?? ?????? ??? ???, ????? ?? ?? ?????? ?????? ?? ?? ?????? ???? ??? ?????. ? ??? ??? ?? ?? ??? thinkphp ?? ?????? ?? ? ?? ????? ???? ? PHP ?????? ? ? ??? ? ??? ????.
? ??? thinkphp ?? ?????? ??? ????? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!

? AI ??

Undress AI Tool
??? ???? ??

Undresser.AI Undress
???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover
???? ?? ???? ??? AI ?????.

Clothoff.io
AI ? ???

Video Face Swap
??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

?? ??

??? ??

???++7.3.1
???? ?? ?? ?? ???

SublimeText3 ??? ??
??? ??, ???? ?? ????.

???? 13.0.1 ???
??? PHP ?? ?? ??

???? CS6
??? ? ?? ??

SublimeText3 Mac ??
? ??? ?? ?? ?????(SublimeText3)