Welcome Guest, Not a member yet? Register   Sign In
code is not working properly
#3

[eluser]srpurdy[/eluser]
This is posted in the wrong section.

But anyway.

This is a mess.

change to this in yuor controller.
Code:
// $data['countries'] = $this->Model_form->get_countries();
//  $data['bodies'] = $this->Model_form->get_bodies();
//  $data['query']=$this->Model_form->trksearch();
//  $this->Model_form->display();
//  $data['query1']=$this->Model_form->display();
//  $data['query2']=$this->Model_form->display();
  $data['query']=$this->Model_form->display();

change your model function to this
Code:
public function display()
  {
  $make = $this->input->post('mkno');  
  $model = $this->input->post('modno');

  $query = $this->db
     ->where('tbl_sel.mk', $make)
     ->where('tbl_sel.md', $model)
     ->where('mktruck.mkno', $make)
     ->where('mkmodel.modnm', $model)
     ->select('
             tbl_sel.id,
             tbl_sel.km,
             tbl_sel.rgat,
             tbl_sel.bdty,
             tbl_sel.eprc,
             tbl_sel.desr,
             mktruck.mkcmpny,
             mkmodel.modnm
      ')
    ->from('tbl_sel,mkmodel,mktruck')
    ->get();
return $query->result();
}

I think this is what you really want. Although maybe you want a join.

than in your view just do one loop
Code:
<?php foreach($query as $row)
{
}
?>

or

Code:
<?php foreach($query as $row):?>

<html here>

<?php endforeach;?>


Messages In This Thread
code is not working properly - by El Forum - 08-22-2012, 09:05 PM
code is not working properly - by El Forum - 08-23-2012, 02:47 PM
code is not working properly - by El Forum - 08-23-2012, 03:46 PM



Theme © iAndrew 2016 - Forum software by © MyBB