Как вставить первое имя в другую таблицу здесь, мой код вставляет данные в таблицу клиентов, но я хочу вставить первое имя в другую таблицу. Мой код действительно регистрируется.Как вставить имя в другую таблицу в базе данных?
public function actionRegister() {
$model = new Customer('signup');
if (Yii::app()->request->getPost('Customer')) {
$custoerary = Yii::app()->request->getPost('Customer');
$model->attributes = $custoerary;
$model->_active = 1;
$model->last_visted = date('Y-m-d H:i:s');
$model->date_added = date('Y-m-d H:i:s');
$model->store_id = $this->store_id;
if ($model->validate()) {
$model->password = md5($custoerary['password']);
$model->confirmpassword = md5($custoerary['confirmpassword']);
if ($model->save()) {
$selectmode = Customer::model()->find("store_id='" . $this->store_id . "' and email='" . $model->email . "' and password='" . md5($custoerary['password']) . "' ");
if (count($selectmode) != 0) {
Yii::app()->session['customer'] = $selectmode->id;
if (isset($_GET['redirect'])) {
$this->redirect(urldecode($_GET['redirect']));
}
$this->redirect('./');
} else {
$error = "Connection Error! Try again Later";
}
} else {
$error = CHtml::errorSummary($model);
}
} else {
$error = "Emailid already Exists!";
}
}
if ($this->session_id != 0) {
if (isset($_GET['redirect'])) {
$this->redirect(urldecode($_GET['redirect']));
}
$this->redirect('./');
}
$this->render('signup', array('error' => $error, 'facebookurl' => $loginUrlFacebook, 'googleurl' => $loginUrlGoogle, 'model' => $model, 'model_advertisement' => $model_advertisement, 'model_slider' => $model_slider, 'model_product' => $model_product, 'model_category' => $model_category, 'model_brand' => $model_brand), false, true);
}
Я хочу, чтобы при регистрации клиента в то время первое имя вставлялось в другую таблицу. как?
хорошо, но где я пишу этот код? –
У меня есть ответ – scaisEdge
Регистрация успехов, но не удалось сохранить данные –