Greeting to all :)
i wanted to store a selected option in to mysql database
My senior said must in this format"
option 1
option 2
option 3
I was stuck with this couple hours ago!
i have think of nl2br but i'm not familiar with it
Can anyone help?
here my code for the html:
<select id="inform_relevant_person" name="pic_option[]"size="10" multiple="multiple">
<option value="0449" selected>0449</option>
<option value="1250" selected>1250</option>
<option value="1434" selected>1434</option>
</select>
this is in a post method from where the form action are testing.php
testing.php:
$pic_staffcode = $_POST[pic_option];
var_dump($pic_staffcode);
foreach($pic_staffcode as $value){$pic_staffcodeS = "'".$pic_staffcodeS."'" . $value."\n";}
i know here the problem ! ut i dono how to solve
here the continue of testing.php
$qryInsertLeaveApplication = "INSERT INTO global_leave_replacement_application (pic_staffcode)VALUES('".nl2br($pic_staffcode)."');