I have a table like this :
When I click update link, I want to echo the "nim" column (first column) to this page inside the nim input text.
Here is my controller
public function fupdate() {
$this->load->view('update_form_mhs');
}
public function update() {
}
Here is my view:
<tr>
<td>NIM</td>
<td><input type="text" placeholder="enter nim" name="nim"></td>
</tr>
How do I echo that?
You can send data from the listing page through GET
method like:
<a href="xyz.php?nim=9004">9004</a>
And in the form page,
get nim
through $_GET['nim']
So, the corrected code:
<td><input type="text" placeholder="enter nim" name="nim" value="<?php echo $_GET['nim']?>"/></td>
In the update method you need to do the following:
Now, since you haven't posted any code which relates to the actual fetching of the data, I'm afraid I cannot help you further with that. However, this step is pretty basic and should be well documented in the CI manual.