Hi,
my question its simple
i have the user table
but in profile form user only can edit email and phone number
my rules:
public function rules()
{
// NOTE: you should only define rules for those attributes that
// will receive user inputs.
if(!Yii::app()->user->isGuest) // Profile updating
{
return array(
array('email', 'required'),
array('email', 'email'),
array('email', 'unique', 'message' => UserModule::t("This user's email adress already exists.")),
array('phone', 'length', 'max'=>13, 'min' => 9,'message' => UserModule::t("Incorrect username (length between 3 and 20 characters).")),
);
when form submit, not only phone and email got update, every user date will be updated
logs:
Executing SQL: UPDATE `users` SET `id`=:yp0, `status`=:yp1, `username`=:yp2, `password`=:yp3, `email`=:yp4, `phone`=:yp5, `name`=:yp6, `sex`=:yp7, `birthday`=:yp8, `raffles`=:yp9, `raffletotal`=:yp10, `raffletotalbuy`=:yp11, `membersince`=:yp12 WHERE `users`.`id`='1'
in D:\wamp\www\yii\ecorifa\protected\modules\user\controllers\ProfileController.php (36)
in D:\wamp\www\yii\ecorifa\index.php (22)
does it affect performance by do such unnecessary sets?
thanks