Welcome Guest, Not a member yet? Register   Sign In
Model linking issue
#1

[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!


Messages In This Thread
Model linking issue - by El Forum - 05-24-2013, 09:17 PM
Model linking issue - by El Forum - 05-28-2013, 04:20 AM



Theme © iAndrew 2016 - Forum software by © MyBB