[eluser]Ludovic-r[/eluser]
Just modified a bit my view form to get this :
Code:
echo form_open('admin/update_categories/');
if (isset($result)) {
$i = 0;
foreach ($result as $row) {
$i++;
$test = array($i => 'category_name');
echo form_input($test[$i].'_'.$i ,$row->category_name);
}
} else { echo 'no categories'; }
echo form_submit('','Save');
echo form_close();
Which gave me something like this :
<input type="text" name="category_name_1" value="myname">
<input type="text" name="category_name_2" value="anothername">
<input type="text" name="category_name_3" value="andanotherone">
... there are as many input field as entries in the DB
These inputs can be edited to change the name of the category.
Ok now my DB Table called 'ft_categories' looklike this :
id = '1' category_name ="myname"
id = '2' category_name ="anothername"
id = '3' category_name ="andanotherone"
The only thing I need is when I press "Submit" the entire table updates with the new entries
Any ideas please?