Codeigniter active query error -


here query

$this->db->select('amount savingamount');     $query  = $this->db->get_where('cashman_trial_balance',array('category_id'=>'176','clientid'=>$user['userid'],'year'=>$year)); 

on checking in browser generating query below

select *, *, `amount` savingamount (`cashman_trial_balance`) `category_id` = '176' , `clientid` = '122' , `year` = '2015/2016' 

i dont know 2 stars coming from?

controller code

$som_var = $this->client->statistics();  

model code

function statistics()  {  /* other queries */  $b = $this->get_balances();  }  function get_balances()  {  $this->db->select('amount savingamount');  $query = $this->db->get_where('cashman_trial_balance',array('category_id'=>'176','clienti‌​d'=>$user['userid'],'year'=>$year));  return $query->result();  } 

use this

      $query = $this->db->query("select amount savingamount table_name category_id = '176'        , clientid = '$user['userid']' , 'year'= '$year') ");       $result = $query->result_array();       return $result; 

Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -