Home  >  Q&A  >  body text

How to implement replace into in thinkphp5.1

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.

王珂王珂1675 days ago1142

reply all(0)I'll reply

No reply
  • Cancelreply