Hi all,
This question has some mysql, but I think is more php based so I am asking it here. I have a form that someone fills out, the form works fine and submits the info to the database fine, but I have one option I am trying to get to submit to two columns in the database table instead of just one (and I want a little diff info going to each).
The form element is a pull-down list of names. The display on the page is the Name and behind it each name has an ID. I want the name itself to go into one column and the ID into another. I can do either or at the moment but not both. The tidbit of code that handles the pulldown is below.
echo "<tr class='even'><td valign='top' class='leftvalue'>".$strings["b_version"]." :</td><td><select name='bversion'>";
for ($i=0;$i<$comptAssignOwner;$i++) {
if ($contestDetail->contest_bversion[0] == $assignOwner->sdesk_id[$i]) {
echo "<option value='".$assignOwner->sdesk_id[$i]."' selected>".$assignOwner->sdesk_bversion[$i]."</option>";
} else {
echo "<option value='".$assignOwner->sdesk_id[$i]."'>".$assignOwner->sdesk_bversion[$i]."</option>";
}
}
echo "</select>";
What the above is showing is two things: $assignOwner->sdesk_id[$i] is the ID that is getting imported into the database and $assignOwner->sdesk_bversion[$i] is the display of the Name itself. I can put either or for the value to be imput into the database. I want to have it so that when a person selects one of these items, it will not only put one, but both items in the database and into diff columns. The name=bversion is what is controling what column it currently inserts the one item into. Any ideas? Thanks!