[eluser]epseix[/eluser]
Hi everyone,
I'm beginning my journey with Codeigniter and following user guide. The model section has confused me greatly.
I have following controller about.php:
Code:
<?php
class About extends CI_Controller{
function About(){
parent::Controller;
}
function index(){
$this->load->model('About_model');
$data['query'] = $this->About_model->about_get();
$this->load->view('about_view', $data);
}
}
?>
View about_view.php:
Code:
<html>
<head>
<title></title>
</head>
<body>
<?php
foreach($query as $row){
print $row->intId;
print $row->strId;
}
?>
</body>
</html>
And Model about_model.php:
Code:
<?php
class About_model extends CI_Model{
function About_model(){
parent::Model;
}
function about_get(){
$this->load->database();
$query = $this->db->get('myDb');
return $query->result();
}
}
?>
Just trying to get a basic linkup established, and experiment from there... But it's not working!
Can anybody steer me in the right direction?
Thanks!