title: Yii's updateByPk keeps returning 0
body: <p>I'm trying to update my user table, which my code does. but for some reason it keeps executing the else statement.</p>
  
  <p>in the <a href="http://www.yiiframework.com/doc/api/1.1/CActiveRecord#updateByPk-detail" rel="nofollow">documentation</a> it states that <code>updateByPk</code> should return the number of rows being updated. Which should be 1. what am i missing here? and how do i check if the table has been updated successfully?</p>
  
  <pre><code>if (User::model()-&gt;updateByPk($model-&gt;id, array("last_login"=&gt; Shared::timeNow())))
  {
      Yii::app()-&gt;user-&gt;login($identity, $duration);
      echo json_encode(array('error' =&gt; false, 'success' =&gt; url(app()-&gt;users-&gt;getHomeUrl())));
      Yii::app()-&gt;end();
  } 
  else {
      echo json_encode(array('error' =&gt; 'Could not update user info', 'code' =&gt; 'auth'));
      Yii::app()-&gt;end();
  }
  </code></pre>
  
  <p>my table schema is this</p>
  
  <pre><code>CREATE TABLE IF NOT EXISTS `user` (
  `id` int(10) unsigned NOT NULL,
    `username` varchar(100) DEFAULT NULL,
    `email` varchar(255) NOT NULL,
    `first_name` varchar(45) NOT NULL,
    `last_name` varchar(45) NOT NULL,
    `gender` char(1) DEFAULT NULL,
    `birthday` date DEFAULT '0000-00-00',
    `address` varchar(255) DEFAULT NULL,
    `city` varchar(45) DEFAULT NULL,
    `state` varchar(45) DEFAULT NULL,
    `website` text,
    `postal_code` varchar(45) DEFAULT NULL,
    `phone` varchar(45) DEFAULT NULL,
    `password` varchar(63) DEFAULT NULL,
    `activate` varchar(63) NOT NULL DEFAULT '1',
    `create_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `last_login` datetime DEFAULT NULL,
    `password_reset` int(11) unsigned DEFAULT NULL,
    `admin` tinyint(1) unsigned NOT NULL DEFAULT '0',
    `email_verified` tinyint(1) unsigned DEFAULT NULL,
    `login_disabled` tinyint(1) unsigned NOT NULL DEFAULT '0',
    `oauth_id` bigint(20) DEFAULT NULL,
    `oauth_username` varchar(255) DEFAULT NULL,
    `oauth_provider` varchar(10) DEFAULT NULL,
    `oauth_email` varchar(255) DEFAULT NULL
  ) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;
  </code></pre>