[eluser]draconus[/eluser]
I am in need of a little assistance with an sql insert. I start with processing a validated form and call the model and function I set up for this insert. So far so good, I even echoed out the post array to ensure that the model is getting the data it needs. From there I do the insert, which does create a new row in my table, but does not pass the form data in. here is my model code that I created for this:
Code:
function insert_user(){
$this->input->post('firstName');
$this->input->post('lastName');
$this->input->post('username');
$this->input->post('password');
$this->input->post('email');
$this->db->insert('users', $this);
}
And to test that the model has the information it needs, I used the following line of code at the beginning of the insert_user function:
Code:
echo $this->input->post('firstName');
Which displays the data on screen correctly.
What could I be doing wrong that it is inserting an empty record into the table and not filling in the form fields? I thought originally that the trim on the form_validation may be the likely culprit, but if i can echo out the post data correctly from the model, then this couldn't be the case, correct?