07-02-2007, 04:21 PM
[eluser]ikim[/eluser]
Hi,
Im starting to learn how to keep all database stuff inside models and separate it from the controllers. However, Ive been looking around and I cant seem to understand how to insert data into the database.
Right now I have a small form in my view sending the form to the controller.
and then the model has
What am I missing? Ive been reading the user quide and trying to find something on the forum but I cant seem to find anything.
Thanks for the help
Hi,
Im starting to learn how to keep all database stuff inside models and separate it from the controllers. However, Ive been looking around and I cant seem to understand how to insert data into the database.
Right now I have a small form in my view sending the form to the controller.
Code:
function insert()
{
$this->load->model('Test');
$this->Test->insert_info();
}
and then the model has
Code:
function insert_info()
{
$data['user_id'] = $_POST['user_id'];
$data['about_me'] = $_POST['about_me'];
$data['tagline'] = $_POST['tagline'];
$this->db->set('personality', $data);
}
What am I missing? Ive been reading the user quide and trying to find something on the forum but I cant seem to find anything.
Thanks for the help