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