I m beginner in codeignitor.my problem is when i fetch data from database all other data has fetched but image are not displayed.please proveide me code for how to fetch image from database.
model file code
class Car_model extends CI_Model
{
function getAllRecords()
{
$this->load->database();
$q = $this->db->get('cardetails');
if($q->num_rows() > 0)
{
return $q->result();
}
return array();
}
}
?>
controller file code
class Search extends CI_Controller {
function searchname()
{
$this->load->model("car_model");
$data['records'] = $this->car_model->getAllRecords();
$this->load->view('header_view');
$this->load->view('search',$data);
$this->load->view('footer_view');
}
}
?>
view file code
foreach($records as $row):
?>
endforeach;
?>
1 Reply
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Dipankar BiswasPosted Sep 4, 2014, 9:36 AM