title: Why am I getting an "array to string conversion" error in CodeIgniter?
body: <p>I'm currently having a problem with this error:</p>
  
  <blockquote>
    <p>array to string conversion</p>
  </blockquote>
  
  <p>Here's the code:</p>
  
  <p>controller:</p>
  
  <pre><code>function get_tariff()
  {      
     $this-&gt;load-&gt;model('model_tariff');
     $data['destination']=$this-&gt;input-&gt;post('dest',true);
     $data['lines']=$this-&gt;input-&gt;post('lines',true);
     $data['weight']=$this-&gt;input-&gt;post('weight',true);
     $data['priceperkg']=$this-&gt;model_tariff-&gt;get_tariff();
     $data['pricetotal']=$data['priceperkg']* $data['weight'];
     $this-&gt;load-&gt;view('tariff_result',$data);
  }
  </code></pre>
  
  <p>model:</p>
  
  <pre><code>function get_tariff()
  {        
     $destination=$this-&gt;input-&gt;post('dest');
     $lines=$this-&gt;input-&gt;post('lines');
     $weightt=$this-&gt;input-&gt;post('weight');
     $this-&gt;db-&gt;select('price');
     $this-&gt;db-&gt;from('view_tariff');
     $this-&gt;db-&gt;where('city_name',$destination);
     $this-&gt;db-&gt;where('lines',$lines);
     $price=$this-&gt;db-&gt;get();
     return $price-&gt;result();    
  }
  </code></pre>
  
  <p>view:</p>
  
  <pre><code>Price per kg &lt;?php echo $priceperkg?&gt;;
  Bayar total &lt;?php echo $pricetotall?&gt;;
  </code></pre>