[eluser]Unknown[/eluser]
hi im a newbie in CI.
i have a drop-down list which pulls from values from my database table.
table_name='state' have columns-
id and branch_name.
Drop down list looks like this:
<select name="branch" >
<option></option>
<?php
if (isset($state_array)) {
foreach ($state_array as $row) {
?>
<option value="<?php echo $row->id; ?>"><?php echo $row->branch_name; ?></option>
<?php
}
}
?>
</select>
The above code gives a list of all the states in my database.
Now, i have a second table assign_task
which have columns = id, task_code, branch_name.
when a user submits a value from the select drop down, it only updates the id column while the branch_name is not populated.
I want the two columns, id and branch id in the assign_task table to be populated with their values once a user submits a value from the list. Does anyone know how i can get around this?
Thanks