Welcome Guest, Not a member yet? Register   Sign In
Save List Box Values in Many Tables
#2

[eluser]Derdiusz[/eluser]
Name your list box "as array" like:
Code:
<select name="right_side[]" multiple>
...
</select>
after posting your form (ie. with method="POST") you have $_POST['right_side'] which is an array with values from select. You can do:

Code:
foreach($_POST['right_side'] as $v)
{
$this->db->insert('your_table', array('right_value'=>$v));
}


Of course this is a sample code. right_value from insert query is a field in your database table.

Greetings
D.


Messages In This Thread
Save List Box Values in Many Tables - by El Forum - 08-27-2010, 11:28 PM
Save List Box Values in Many Tables - by El Forum - 08-28-2010, 02:54 PM
Save List Box Values in Many Tables - by El Forum - 08-29-2010, 10:17 PM



Theme © iAndrew 2016 - Forum software by © MyBB