I figured it out. There was a phpmyadmin glitch, so it’s not a Yii problem
For some reason, active record is saving something that shows up as a link in my integer ID field in a database. Here’s my controller action:
public function actionEditInfo()
{
if(!Info::model()->exists('id=:id',array(':id'=>Yii::app()->user->id))) {
$model = new Info;
} else {
$model = Info::model()->findByPk(Yii::app()->user->id);
}
if(isset($_POST['info'])) {
$model->attributes = $_POST['info'];
$model->id = Yii::app()->user->id;
if($model->save()) {
$this->redirect(array('member/account'));
}
}
$this->render('editInfo',array('model'=>$model));
}
Yii::app()->user->id is an integer, in this case ‘12’. Anywhere I put an echo or var_dump, it returns 12 as planned; there’s a validation rule in the model that verifies that it is an integer. But, for some reason, after $model->save() is invoked, it get stored in the database as ‘-sc1245 (blank lines) sc1245-’. That’s the first part of an email address, but it’s beyond me why the application is storing this, or where it’s even finding that value.
Does anybody know if this is a bug? I’m using the newest version of Yii, and have never come across a problem like this before.