迅睿CMS框架是一款PHP8高性能·簡單易用的CMS開源開發(fā)框架,基于MIT開源許可協(xié)議發(fā)布,免費且不限制商業(yè)使用,是免費開源的產(chǎn)品,以萬端互聯(lián)為設(shè)計理念,支持的微信公眾號、小程序、APP客戶端、移動端網(wǎng)站、PC網(wǎng)站等多終端式管理系統(tǒng)。
聯(lián)系官方銷售客服
1835022288
028-61286886
沒有批量寫入數(shù)據(jù)庫的方法嗎?我看了基本都是for循環(huán)一條條寫入,有沒有僅僅一條sql就可以搞定的,thinkphp封裝了 insertAll() 方法,不知道迅睿有沒哦
REPLACE INTO mytable (title, name, date) VALUES ('My title', 'My name', 'My date')
回復(fù)@不得不服 是批量哦,一下子寫入多條記錄
比如添加一條:\Phpcmf\Service::M()->table('app_seomatrix_list')->insert($addData);那么添加多條可以這樣嗎:\Phpcmf\Service::M()->table('app_seomatrix_list')->insertBatch($addData); 系統(tǒng)報錯
回復(fù)@不得不服 是批量哦,一下子寫入多條記錄
比如添加一條:\Phpcmf\Service::M()->table('app_seomatrix_list')->insert($addData);
那么添加多條可以這樣嗎:\Phpcmf\Service::M()->table('app_seomatrix_list')->insertBatch($addData); 系統(tǒng)報錯