[eluser]srpurdy[/eluser]
simply create an extraction db call like below
Model
Code:
function edit_post()
{
$edit_post = $this->db->getwhere('guestbook', array('id' => $this->uri->segment(4)), '', '');
return $edit_post
}
the 4th uri segment should be the post ID number. however use this however you need it. if you use segment 3 than do that.
controller
Code:
$data['edit_post'] = $this->your_model->edit_post();
than do a foreach loop over the html <form>. and echo the results inside the value of the text box or textarea.
for example
Code:
<?php foreach($edit_post->result() as $edit): ?>
<form action="your_form_action" method="post" enctype="multipart/form-data">
<input type="text" class="field" name="somefield" value="<?=$edit->somefield?>" /><br />
</form>
<?php endforeach;?>
I noticed your using the ci form feature, but its not different just echo your field into the value="";
For update
Code:
function update_post()
{
$this->db->where('id', $_POST['id']);
$this->db->update('guestbook', $this->db->escape($_POST));
}