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
https://forums.phpfreaks.com/topic/284599-codeigniter-insert-data/
Share on other sites

Archived

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

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