Hi
with below code I giving error:
$user = new \Modules\Shared\Models\Profile();
$user->username = $this->request->getPost('username');
.
.
.
if ($user->create() == false)
{
// Failed
foreach ($user->getMessages() as $message) {
$message = $message;
}
$this->flash->error($message);
}
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'emo' for key 'username'' in /home/mojir/www/apps/frontend/controllers/AuthController.php:281 Stack trace: #0 [internal function]: PDOStatement->execute() #1 [internal function]: Phalcon\Db\Adapter\Pdo->executePrepared(Object(PDOStatement), Array, Array) #2 [internal function]: Phalcon\Db\Adapter\Pdo->execute('INSERT INTO `ma...', Array, Array) #3 [internal function]: Phalcon\Db\Adapter->insert('match_users', Array, Array, Array) #4 [internal function]: Phalcon\Mvc\Model->_doLowInsert(Object(Phalcon\Mvc\Model\MetaData\Memory), Object(Phalcon\Db\Adapter\Pdo\Mysql), 'match_users', false) #5 [internal function]: Phalcon\Mvc\Model->save() #6 /home/mojir/www/apps/frontend/controllers/AuthController.php(281): Phalcon\Mvc\Model->create() #7 [internal function]: Modules\Frontend\Controllers\AuthController->registerAction() #8 [internal function]: Phalcon\Dispatcher->dispatch() #9 /home/mojir/www/publi in /home/mojir/www/apps/frontend/controllers/AuthController.php on line 281
and if ($user->create() == false)
is in line 281 !
so I can not handle the error message anyway