Answer the question
In order to leave comments, you need to log in
SQLSTATE[42602]: Invalid name: 7 ERROR: invalid name syntax?
There is a standard CRUD from GII per model.
Framework Yii2.
Postgresql database.
I work with basis through Active Record.
When editing the model - everything is ok.
But when creating a new one while saving: I get an error
SQLSTATE[42602]: Invalid name: 7 ERROR: invalid name syntax
return $this->db->pdo->lastInsertId($sequenceName === '' ? null : $sequenceName);
Answer the question
In order to leave comments, you need to log in
Yes, it seems like there is no such problem - there are 2 databases in the project: mysql + postgresql.
Looked into Schema.php:
public function getLastInsertID($sequenceName = '')
{
if ($this->db->isActive) {
return $this->db->pdo->lastInsertId($sequenceName === '' ? null : $this->quoteSimpleTableName($sequenceName));
} else {
throw new InvalidCallException('DB Connection is not active.');
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question