Unknown column |
[eluser]umefarooq[/eluser]
Hi im posting data from form to model after getting all post it give me this error.Unknown column '_module' here is my code Code: $this->db->insert('flipp_settings',$this);
[eluser]GSV Sleeper Service[/eluser]
take a look at the active record insert example. - http://ellislab.com/codeigniter/user-gui...mples.html the second parameter to db->insert should be an associative array of values. you are passing $this as the second parameter, and $this refers to the CI superobject.
[eluser]GSV Sleeper Service[/eluser]
hmmm, that's a very confusing example. what else does $this contain?
[eluser]wiredesignz[/eluser]
$this = the model object, and the db driver will try to use every class variable of the model object to build it's insert SQL, as per the example you show. Unless your table has a _module column I recommend that you change the way you are using insert because your model object appears to have class variables that are not in your table.
[eluser]Colin Williams[/eluser]
I don't think Models should be used to represent objects, as you are doing in this context. I mean, you certainly can do it, but you need to consider the constraints and caveats of doing this. |
Welcome Guest, Not a member yet? Register Sign In |