Jump to content

Archived

This topic is now archived and is closed to further replies.

Yohanne

codeigniter insert data

Recommended Posts

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');
		}
	}
}

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.