Insert error when sending post array to activerecord
Posted
by
Gonzalo
on Stack Overflow
See other posts from Stack Overflow
or by Gonzalo
Published on 2014-06-09T21:45:02Z
Indexed on
2014/06/10
3:25 UTC
Read the original article
Hit count: 205
I am using CodeIgniter + phpActiveRecord. I am getting all the records from the $_POST
array and I want to send that same array to my activeRecord class to insert the data into the DB.
This line doesn't seem to be working but I can't get the error because the page is just blank:
Car::create($this->input->post());
If the names of the fields are equal to the names of the columns in the table, should it what I pasted above work?
==========SOLVED========
It is possible to do it, and in the model of the object one can add var $name_of_the_field_which_you_don't_process = FALSE;
And that's it.
© Stack Overflow or respective owner