Forum Moderators: coopster

Message Too Old, No Replies

multiple select into mysql

multiple select into mysql

         

janim

10:34 pm on Aug 5, 2007 (gmt 0)

10+ Year Member



hey guys
how you doin
i want to insert multiple selection into mysql like this
<select name="time" multiple="multiple">
<option></option>
</select>
i tried this
$arr = $_POST['position'];
foreach($arr as $position){
$time=$position;
}
.
.
$insert = mysql_query("insert into $table values ('NULL', '".$_POST['time']."'
but it's not work it insert into mysql just one value
i want when the user ctl+click to choose more than one
to insert all selected values into mysql
so please help me about it

Habtom

4:57 am on Aug 6, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Your insert statement needs to be inside the foreach loop.

Habtom