A
Anonymous
Guest
I use 'explode' function to split a string (from multiple selection) to be inserted into mysql text field.
this is my multiple selection code
And this is my query and 'explode' function
It works fine when inserted into text field. What I got in text field is similar like this:
ABC,DEF,GHI,JKL
What I want is how to pull that string (to be updated) into multiple selection so that it will appears like this
____________
ABC
DEF
GHI
JKL
____________
and it will select any options that was selected previously
And one more question:
How to have my browser address show PHP session id
sample:http://www.php-forum.com/p/login.php?sid=e461ef9f4deb7f8d31c44aac1e592f0a
Thanks
this is my multiple selection code
Code:
echo "<select name='bcc[]' size='5' multiple>";
$query = "select value, label from bcc order by label asc";
$result = mysql_query($query);
while($row = mysql_fetch_array($result))
{
echo '<option value='.$row['value'].'>'.$row['label'].'</option>';
}
mysql_free_result($result);
echo "</select>";
And this is my query and 'explode' function
Code:
$bcc = explode(",", $bcc);
$query2 = "INSERT INTO maintable (nama, org, bcc) VALUES ('$nama', '$org', '$bcc')";
It works fine when inserted into text field. What I got in text field is similar like this:
ABC,DEF,GHI,JKL
What I want is how to pull that string (to be updated) into multiple selection so that it will appears like this
____________
ABC
DEF
GHI
JKL
____________
and it will select any options that was selected previously
And one more question:
How to have my browser address show PHP session id
sample:http://www.php-forum.com/p/login.php?sid=e461ef9f4deb7f8d31c44aac1e592f0a
Thanks