We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

repeted insertion of data in database

I have userController with addworkAction witch save data in database and redirects to user profile page but if I refresh that page it again inserts data in database. How can I stop inserting data again and again



58.4k
Accepted
answer
edited Mar '14

@sayaliChavan You try Tag::resetInput

if ($post->save() ==true) {
    $this->flash->success("Add Post success");
    Tag::resetInput();
    return $this->dispatcher->forward(array('action' => 'index'));
}

@duythien

it's not working.