Plain php problem help

Need help with a drop-down list on regular php code (not on scriptcase).
I was given a project to change a php program that will have a telephone field with a “click to dial” functionality.
Since I don’t know how to do this in Scriptcase, and I have to have a system with available telephones to dial out, I decided to just change the regular php program but I am stuck changing the old drop-downs.
The old system only uses the values from a plain hard-coded list or a source table and stores the same values on a target table which is where we insert or update school records.
As an example: the school_name is in a drop down list and works fine but I in the new system I need to do the following: [LIST=1]

  • Select the ID or record ky and the school name from the schools table.
  • Only display the school names on a drop down list for the user to select one.
  • Store Only the ID or record key on the target table so we are not storing the name on both tables. [/LIST] I have the following SQL query using an associative array to grab both the ID or record key and the value or school name. For some reason the code I have below does not work, the drop-down list is not loaded and the school field name has no width like when the query does not work on a SELECT field in Scriptcase. [I]$sql_statement = "SELECT distinct [B]school_name, school_id[/B] FROM [B]schools[/B] ORDER BY school_id";[/I] [I]$result = $mysqli->query($sql_statement); [/I] [I]echo "<tr><td><b><font size=3 face='arial'>[B]SCHOOL:[/B] </td>[/I] [I] <td><select name='plantel' style='background-color:#96b6c5;' autocomplete='off' onchange='this.form.submit()'>";[/I]

    if ($result) {
    echo “<option>".$row[‘school_name’]."</option>”;

    while($row = $result->fetch_assoc()) {
    echo “<option>".$row[‘school_name’]."</option>”;
    }
    echo “</select></td></tr>”;
    }
    In the picture below I can see the schools from the select statement but they are outside of the drop-down list which is ?SCHOOLS:? the line in red above, I believe I am missing the way to code for <option </option>???

    Well I can’t upload a pic or an attachment, who knows but the fields com up on the page like this:
    NAME - - > INPUT BOX FOR NAME
    LAST NAME – > INPUT BOX FOR LAST NAME
    TELEPHONE - - > INPUT BOX FOR TELEPHONE
    SCHOOL – > INPUT BOX FOR SCHOOL NAME (this is where I expect the selected value to show up but I select it then goes blanks)
    After the school field I see the list of schools but these are all outside of the drop-down list like another web element.

    Any ideas how I can make the results fields from the associative arrey behave like a drop-down list would be great.
    Thank you…