Question : How to use a html form <select> dropdown within a MYSQL while loop table display with php

Hi everyone, difficult to explain so hopefully my code demonstrates what I am trying to do. However, in overview, I have a table display from MYSQL using php. I also have another MYSQL table which stores options for a html dropdown <select>.

What I am trying to do is integrate the table display with the dropdown options with the row data displaying as the selected dropdown choice. Furthermore, I add another option not included in the MYSQL table of options called "Global". How do I integrate that into the equation also?

My Example:

OPTION MYSQL TABLE
------------------------------

Name
-------
Server 1
Server 2
Server 3
//etc

DATA DISPLAY TABLE
-----------------------------

id ---- server --------- info
0 -----  Server 1----- ABC
1 ------ Server 2------ AB
2 -------Server 1----- ABCDE
3------- Server 3------ ABCDEFG
//etc

CODE:

<?php

// Display data table
while ($row= mysql_fetch_array($result))
{
    echo "<td>{$row['id']}<td><select name=\"server\">";

        // Display option column with data
         while ($d_s = mysql_fetch_array($data_server))
         {
                     // Check for the current data and display as default. How to include Global though? Remember is not included in option table
                      if ($row['server'] == $d_s['name'])
                     {
                               echo "<option value=\"{$d_s['name']}\" selected>{$d_s['name']}</option>";
                     }
                      // Display rest of options except the selected one
                                echo "<option value=\"{$d_s['name']}\">{$d_s['name']}</option>"
                                echo "<option value=\"Global\">Global</option>"
         }

echo "</select>";
}

?>

Answer : How to use a html form <select> dropdown within a MYSQL while loop table display with php

Thanks for the suggestions, but I found the solution.  It had to do with the fact that the Citrix server I am using is 4.0 and that does not gel with ZenApp...so the fix is to ensure that theRequireLaunchReference parameter is set to Off and that OverrideIcaClientname is set to On in the XenApp Web site configuration file that is in the inetpub\Citrix folder, the file is called WebInterface.conf.

Thanks again, maybe this posting will help someone else.
Random Solutions  
 
programming4us programming4us