Welcome Guest, Not a member yet? Register   Sign In
How do i Pass in Multiple values into the database from one input filed in CI
#1

[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>
&lt;?php
if (isset($state_array)) {
foreach ($state_array as $row) {
?&gt;
<option value="&lt;?php echo $row-&gt;id; ?&gt;">&lt;?php echo $row->branch_name; ?&gt;</option>
&lt;?php
}
}
?&gt;
</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


Messages In This Thread
How do i Pass in Multiple values into the database from one input filed in CI - by El Forum - 03-05-2012, 07:07 AM



Theme © iAndrew 2016 - Forum software by © MyBB