[eluser]kristo5747[/eluser]
Dear all,
echo-ing $id and $data helped. Nothing was being output therefore nothing was being captured. Doing more reading got to redesign my app.
Now, I rely on a URI on the record I want to update:
1) in my controller, I added this update function
Code:
function update() {
$id = $this->uri->segment(3);
$title = $this->input->post('title');
$content = $this->input->post('content');
$this->posts_model->update_record($id, $title, $content)
}
2) in my model, I added this function
Code:
function update_record($id, $title, $content) {
$data = array(
'title' => $title,
'content' => $content
);
$this->db->where('id', $id);
$this->db->update('data', $data);
}
3) finally, I created a view just for the update
Code:
<?php $this->load->helper('form'); ?>
<?php echo form_open('site/update/'.$id); ?>
<?php echo form_input('title'); ?>
<?php echo form_textarea('content'); ?>
<?php echo form_submit('submit', 'Submit'); ?>
<?php echo form_close(); ?
It works fine now. All I have to do is point my browser to site/update/post-id_number.
What I need to figure out is how to tailor the interface so I can get merge the update view with the other one I have.
Thanks to all of you for taking the time.
Al.