Jump to content

codeigniter insert data


Yohanne

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');
		}
	}
}
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.