Welcome Guest, Not a member yet? Register   Sign In
Doctrine question - SQLSTATE[42S22]: Column not found: 1054 Unknown column in 'field list'
#1

[eluser]Unknown[/eluser]
So I got this project from another developer who is no longer developing, and he did this site with CI, doctrine and ORM designer. I've never used any of them before this project but I'm getting the hang of CI.. however I'm lost in the dark with doctrine and orm..

With that said, I manually created a column in the user table called referred_by, but now when using save() I get errors saying it's not found. I tried to go through the site and manually update the base classes and yaml that would reference it but I'm missing something obviously.

Code:
public function reset_password($user_id, $new_pass, $new_pass_key, $expire_period = 900)
    {
        try
  {
   $q = Doctrine_Query::create()
                 ->from('User u')
                 ->select('u.id')
                 ->where("u.id = {$user_id}")
                 ->andWhere("u.new_password_key = '{$new_pass_key}'")
                 ->andWhere('UNIX_TIMESTAMP(u.new_password_requested) >= ?', time() - $expire_period)
                 ->execute();

         if ($q->count() === 1)
         {
             $user = $q[0];
             $user->password = $new_pass;
             $user->new_password_key = NULL;
             $user->new_password_requested = NULL;
             $user->save();
             return TRUE;
         }

         return FALSE;
  }
  catch (Doctrine_Connection_Exception $e)
  {
   log_message('error', $e->getMessage());
   return FALSE;
  }
    }

As you can see it the save() doesn't do anything directly with that field, but every time save() being used it fails with that error.

Any suggestions?




Theme © iAndrew 2016 - Forum software by © MyBB