How to implement replace into in thinkphp5.1
王珂
王珂 2020-02-23 11:44:25
0
0
1182

if(Comments::create($data)){
$this->success('Comment posted successfully','index/index');
} else {
$this- >error('Comment saving failed','index/index');
}

I have created a unique index in the table. I want the commentator to only post a comment once, and the comment will be correct when sending it again. Previous comments updated and inserted. The above code can only implement insert into. Please help me implement replace into.

王珂
王珂

reply all(0)
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!