combo box value on page reload

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!


I am new to php and mySQL so this is probably something very basic that I'm
missing. Basically, on the page I have 2 combo boxes but 1 of them is not
getting the value passed when the page is reloaded so the database can be
updated. I am echoing the field names passed and the field "theDriver" is
there but it's empty. I've include the code parts where I believe the
problem should be but I'm stumped and I've been trying to solve this for 2
days without success.  Would someone mind examing the following code and
tell me what I've done wrong?

Thanks very much for any help received,


Following code constructs the combo box on the page from a MySQL table:
                        $table = "tblEmployees";
                        $Link = mysql_connect ($host, $user, $password);

                        $Query = "select concat(empID,'; ',empFirstName,'
                            as full_name from $table WHERE empTitle =
                        $results = mysql_db_query($database, $Query, $Link);

                    <select name = "theDriver" size="1">
                        <Option Value=" ">Select One:</option>

                            for($u=0;$u<mysql_num_rows($results); $u++)
                               <option value="<?PHP echo($ID); ?>"><?
echo($driver); ?></option>
                        ?> //end php


When Page is reloaded the following code is run but the combo box titled
"theDriver" is empty

   foreach($_POST as $field => $value)
        echo $field;  //field names from form
        echo "; ";
        if ($field == "theDriver")
            echo " - here's the driver for ya: ";
            $$field = strip_tags(trim($value));
            echo $$field;
            $pos = strpos($driver, ";");
            echo "<br> the ; is in pos $pos <br>";
            echo $value;
        if ($field != "baseCharge" and $field !="extraCharge"
            and $field !="comments" )

          if ($value == "")
            $message_new = "Required information is missing.
                Please try again.";
        $$field = strip_tags(trim($value));

Site Timeline