Dima8249
@Dima8249
Очень кратко - работаю над своим сайтом...

Ошибка при регистрации пользователя, как исправить?

public function accountCreate($dataAccountXCreate) {
$sql = "INSERT INTO `accounts` SET ";
$sql .= "account_email= '" . $this->db->escape($dataAccountXCreate['account_email']) . "', ";
$sql .= "account_password = '" . $this->db->escape($dataAccountXCreate['account_password']) . "', ";
$sql .= "account_firstname = '" . $this->db->escape($dataAccountXCreate['account_firstname']) . "', ";
$sql .= "account_lastname = '" . $this->db->escape($dataAccountXCreate['account_lastname']) . "', ";
$sql .= "account_status = '" . (int)$dataAccountXCreate['account_status'] . "', ";
$sql .= "account_balance = '" . (float)$dataAccountXCreate['account_balance'] . "', ";
$sql .= "account_access_level = '" . (int)$dataAccountXCreate['account_access_level'] . "', ";
$sql .= "account_server = '" . (int)$dataAccountXCreate['account_server'] . "', ";
$sql .= "account_create = NOW()";
$this->db->query($sql);
return $this->db->getLastId();
}


и

$firstname = @$this->request->post['login'];
//$lastname = @$this->request->post['lastname'];
$lastname = "Фамилия";
$email = @$this->request->post['email'];
$password = @$this->request->post['password'];

$dataAccountXCreateb = [
'account_email' => $email,
'account_password' => md5($password),
'account_firstname' => "Имя",
'account_lastname' => "Фамилия",
'account_status' => 1,
'account_balance' => 0,
'account_access_level' => 1,
'account_server' => 1
];

$this->accountsModel->accountCreate($dataAccountXCreateb);
  • Вопрос задан
  • 257 просмотров
Решения вопроса 1
Exploding
@Exploding
wtf?
Начиналось как инсерт, а потом в апдейт потянуло:)
INSERT INTO `accounts` SET
---------
insert into table (...) values (...)
update table set field='value' where ...
Ответ написан
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Похожие вопросы