Welcome Guest, Not a member yet? Register   Sign In
Beginner Problem
#4

[eluser]gunner0007[/eluser]
Thanks for the help, will go through this. Does anyone have any other links or good books/tutorials where I can learn CI?

[quote author="Sanjay Sarvaiya" date="1341385885"]use code tags for code samples.


as per CI-Structure pass operational data from controller to model
your controller code will look like
Code:
//controller
public function update() {
      $this->load->helper(‘form’);

      $data[‘heading’] = ‘Enter Info Here’;
      $data[‘title’] = ‘Update Blog’;
    
    
      $this->load->model(‘news_model’);
      $data['blog'] = array('content', $this->input->post('entry'));//
      $data[‘data’] = $this->news_model->insert_blog($data['blog']);//
    
      $this->load->view(‘update_blog’,$data);
    
  }
//model insert method you have to do just no need to load any library.
public function insert_blog() {    
    $this->db->insert(‘blog’, $data);
    echo $this->db->last_query();die();//your insert query.
  }




[/quote]


Messages In This Thread
Beginner Problem - by El Forum - 07-03-2012, 12:50 PM
Beginner Problem - by El Forum - 07-03-2012, 11:52 PM
Beginner Problem - by El Forum - 07-04-2012, 12:11 AM
Beginner Problem - by El Forum - 07-04-2012, 07:42 AM
Beginner Problem - by El Forum - 07-09-2012, 10:00 PM



Theme © iAndrew 2016 - Forum software by © MyBB