Welcome Guest, Not a member yet? Register   Sign In
Unknown column

im posting data from form to model after getting all post it give me this error.Unknown column '_module'
here is my code

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

ya you are right but here in this exmaple you can see what is the difference. because im following the same way in following example.


[eluser]GSV Sleeper Service[/eluser]
hmmm, that's a very confusing example. what else does $this contain?

$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.

Theme © iAndrew 2016 - Forum software by © MyBB