幾個(gè)比較常見的Thinkphp代碼
慕田峪7331174
2018-07-06 11:10:36
TA貢獻(xiàn)1829條經(jīng)驗(yàn) 獲得超6個(gè)贊
public function test(){ //查詢單條數(shù)據(jù) $result =M( "表名" )->where( "條件" )->find(); //查詢多條數(shù)據(jù) $result =M( "表名" )->where( "條件" )->find(); //刪除數(shù)據(jù) $result =M( "表名" )->where( "條件" )->del(); //修改數(shù)數(shù)據(jù) $data [ '字段名稱' ]= "值" ; $result =M( "表名" )->where( "條件" )->save( $data ); //新增數(shù)據(jù) $data [ '字段名稱' ]= "值" ; $result =M( "表名" )->add( $data ); } |
基操,數(shù)據(jù)庫增刪改查
舉報(bào)