diff --git a/application/models/Question.php b/application/models/Question.php index f61f2552c83..fa5a8e9d945 100644 --- a/application/models/Question.php +++ b/application/models/Question.php @@ -108,7 +108,7 @@ public function rules() public function getMaxId() { $maxId = $this->dbConnection->createCommand() - ->select('MAX(' . $this->primaryKey() . ')') + ->select('MAX(qid)') ->from($this->tableName()) ->queryScalar(); return $maxId;