Welcome Guest, Not a member yet? Register   Sign In
Problem in updating field please help
#1

[eluser]dhaulagiri[/eluser]
It says , you must use the "set" method to update an entry. Pls help

My model is
Code:
$this->db->where('id', $this->uri->segment(3));
$this->db->update('mytable', $data);


My controller is
Code:
$data = $this->db->select('mytable', $_POST);
$this->contact_model->model_update_function($data);
#2

[eluser]falkencreative[/eluser]
What is the current result you are getting? Are you getting any errors?

I would assume that you've looked at the user guide's section on this and made sure your code is matching up? http://ellislab.com/codeigniter/user-gui...tml#update
#3

[eluser]dhaulagiri[/eluser]
I have a notice Message: undefined variable data, can anyone give me working example of updating tables in database ?
#4

[eluser]falkencreative[/eluser]
The User Guide has pretty clear examples on how to use the update function: http://ellislab.com/codeigniter/user-gui...tml#update

I am confused by this line: "$data = $this->db->select('mytable', $_POST);" since I believe your $data array needs to pass in the values you want to update, and you're using a select() function which grabs data from the database (http://ellislab.com/codeigniter/user-gui...tml#select)




Theme © iAndrew 2016 - Forum software by © MyBB