Welcome Guest, Not a member yet? Register   Sign In
Codeigniter Message: Undefined variable: infos why cant I connect the abouts table?
#14

[eluser]theprodigy[/eluser]
Quote:
Code:
class About_model extends CI_Model {
    function getAll() {
        $q = $this->db->get('abouts');
        if($q->num_rows() > 0){
            foreach ($q->result() as $row)
            {
                $data[] = $row;
            }
            return $data;
        }
    }
}
Try changing your getAll function to
Code:
class About_model extends CI_Model {
    function getAll() {
        $q = $this->db->get('abouts');
        $data = array();
        if($q->num_rows() > 0){
            foreach ($q->result() as $row)
            {
                $data[] = $row;
            }
        }
        return $data;
    }
}
After making that change, try running print_r on it again and see what happens.


Messages In This Thread
Codeigniter Message: Undefined variable: infos why cant I connect the abouts table? - by El Forum - 08-05-2012, 02:07 PM



Theme © iAndrew 2016 - Forum software by © MyBB