Answer the question
In order to leave comments, you need to log in
Why don't save() and create() work in Phalcon?
the specified functions do not work, they always return false.
$accounts = new Accounts();
$accounts->login = $username;
$accounts->password = $password;
$accounts->steam_guard = $steam_guard;
$accounts->worker_id = $worker_id;
$this->response->setJsonContent(['good' => $accounts->save()])->send();
Answer the question
In order to leave comments, you need to log in
It cannot be so. Either the framework will throw an exception in case of problems with connecting to the database, or getMessages () contain information about the error.
$accounts = new Accounts;
$accounts->login = 'test';
$accounts->password = 'ABCDEF';
$accounts->steam_guard = '0';
$accounts->worker_id = '1';
if ($accounts->save() === false) {
$messages = $accounts->getMessages();
foreach ($messages as $message) {
echo $message, "\n";
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question