title: Update and Join query together in codeigniter?
body: <p>Updating data while join two tables but it gives an error in where condition 
  can i use join and update together in a query ?</p>
  
  <p>here is my code </p>
  
  <pre><code>public function update_model($id,array $data)
  {
  
  //$textArea=$data['textdata'];
  $this-&gt;db-&gt;join('user_data', 'user.id = user_data.id');
  $this-&gt;db&gt;where('user_data.id',$id);
  $this-&gt;db-&gt;update('user_data',$data);
  
  $query=$this-&gt;db-&gt;get();
  return $query-&gt;result();
  }
  </code></pre>
  
  <p>I got Error like below in my mysql</p>
  
  <blockquote>
    <p>Fatal error: Uncaught Error: Call to undefined function where() in
    C:\xampp\htdocs\P_Display\application\models\Pmodel.php:103 Stack
    trace: #0
    C:\xampp\htdocs\P_Display\application\controllers\user.php(1‌​24):
    Pmodel->update_model('1', Array) #1
    C:\xampp\htdocs\P_Display\system\core\CodeIgniter.php(360):
    User->updateSave('1') #2 C:\xampp\htdocs\P_Display\index.php(202):
    require_once('C:\xampp\htdocs...') #3 {main} thrown in
    C:\xampp\htdocs\P_Display\application\models\Pmodel.php on line 103</p>
  </blockquote>
  
  <p>the where clause is giving me an error and is it correct to use this query ?</p>