Welcome Guest, Not a member yet? Register   Sign In
Public Variables With Models?
#4

[eluser]cahva[/eluser]
Example:
Code:
class News extends Model {

    function __construct()
    {
        parent::__construct();
    }
    
    function articleInfo($id)
    {
        return $this->db->where('id',$id)->get('news')->row();
    }

}

As you can see articleTitle is nowhere to be found in the model. Thats because it comes from db(the field in the news table is "articleTitle").

EDIT: Oh yeah, almost forgot. Dont use uppercase letters in your database. That can cause trouble later(exporting).


Messages In This Thread
Public Variables With Models? - by El Forum - 08-30-2010, 03:49 PM
Public Variables With Models? - by El Forum - 08-31-2010, 03:04 AM
Public Variables With Models? - by El Forum - 08-31-2010, 06:03 PM
Public Variables With Models? - by El Forum - 08-31-2010, 06:18 PM



Theme © iAndrew 2016 - Forum software by © MyBB