Hi guys. I really need so help with this if you can please.
I have a combo box with the value 'ISB001- team projects'. When this is selected, and submitted I want to insert only the code part - 'ISb001' into a 'module' table of my sql database. Is there any way to insert just the code and not the course title part of this combo box entry?
Thanks in advance
Ant
how to insert values from a combo box to a database??
Moderator: General Moderators
-
ant_sutton
- Forum Commoner
- Posts: 32
- Joined: Thu May 05, 2005 5:27 am
-
ant_sutton
- Forum Commoner
- Posts: 32
- Joined: Thu May 05, 2005 5:27 am
thanks
Hi. Thanks for your quick reply I'm actually taking the code ISB001 from the modulecode field of the table and course title from the title field. I am then looping round and inserting them into the combo box. Would the 'select value' still work, or is there another way to do this?
Anthony
Anthony
Yes.
Code: Select all
$row = mysql_fetch_array($result);
loop
{
echo '
<option value="'.$row['modulecode'].'">'.
$row['modulecode'].' - '.$row['title'].'
</option>
';
}