Yohanne Posted December 7, 2013 Share Posted December 7, 2013 Hi Coders, i search in many times in Google oh how to insert data. but i did not found what i'm looking. please any body can share how to manage in how to insert data. i have the following below and i really don't know what is next steps. class ModelRegistration extends CI_Model { function __construct { parent::__construct(); { function i_account() { } } class Form extends CI_Controller { function index() { $this->load->helper(array('form','url')); $this->load->library('form_validation'); $this->form_validation->set_rules('fname', 'First Name', 'required'); $this->form_validation->set_rules('lname', 'Last Name', 'required'); $this->form_validation->set_rules('emailadd', 'Email Address', 'required'); $this->form_validation->set_rules('avatar', 'Avatar', 'required'); $this->form_validation->set_rules('month', 'month', 'required'); $this->form_validation->set_rules('year', 'Year', 'required'); $this->form_validation->set_rules('day', 'Day', 'required'); $this->form_validation->set_rules('gender', 'Gender', 'required'); $this->form_validation->set_rules('username', 'Username', 'required'); $this->form_validation->set_rules('password', 'Password', 'required'); $this->form_validation->set_rules('password_c', 'Password Confirmation', 'required'); if ($this->form_validation->run() == FALSE) { $this->load->view('myform'); } else { $this->load->model('ModelRegistration'); $this->ModelRegistration->i_account(); $this->load->view('formsuccess'); } } } Link to comment https://forums.phpfreaks.com/topic/284599-codeigniter-insert-data/ Share on other sites More sharing options...
PravinS Posted December 7, 2013 Share Posted December 7, 2013 http://ellislab.com/codeigniter/user-guide/database/active_record.html#insert Link to comment https://forums.phpfreaks.com/topic/284599-codeigniter-insert-data/#findComment-1461555 Share on other sites More sharing options...
Yohanne Posted December 7, 2013 Author Share Posted December 7, 2013 Thanks for your response. my problem is how to call a model, since i have already have validation for my post. i dont know how it do it correct. please guid me since i am starter. Link to comment https://forums.phpfreaks.com/topic/284599-codeigniter-insert-data/#findComment-1461557 Share on other sites More sharing options...
PravinS Posted December 7, 2013 Share Posted December 7, 2013 you can check this url for that http://ellislab.com/codeigniter/user-guide/general/models.html#loading Link to comment https://forums.phpfreaks.com/topic/284599-codeigniter-insert-data/#findComment-1461558 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.