数据库大作业笔记(九) 发表于 2019-05-15 mysql抛出异常: 12345IF(!(new.eqpid LIKE CONCAT(new.catid,'%'))) THEN SIGNAL SQLSTATE 'HY000' SET MESSAGE_TEXT = '输入错误' ; -- set new.eqpid=NULL; ELSE insert into audit_equipment VALUES(new.eqpid,user(),now(),1); END IF; php: 12345678910111213{try{ $model = new Equipment(); if ($model->load(Yii::$app->request->post()) && $model->save()) { return $this->redirect(['view', 'id' => $model->eqpid]); }}catch(\Exception $e){ } return $this->render('create', [ 'model' => $model,]);}