Here is an example using Pear::DB syntax:

<?php
    $data = $dbh->getAll("select keyfield, descfield from table",
DB_FETCHMODE_ASSOC);
    echo "<select name=device>\n";
    foreach ($data as $row) {
        echo "<option value=\"", $row["keyfield"], "\">", $row["descfield"],
"</option>\n";
    }
    echo "</select>\n";
?>

--
Jeremy Bettis
[EMAIL PROTECTED]

"Pete Kuczynski" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> The one line statment below, returns the contents of a cell from a mysql
> database.
>
> Would anyone know how I could change it to a drop down menu. Basically,
> I wan't to be able to query another table, and change devides via the
> drop down menu.
>
> Pete
>
> echo "<td align=right>Device:  <input type=text name='device'
> value='$row->device'></td><tr>";
>
> --
> _______________________________________
> Pete Kuczynski
> Sr. Field Engineer
> DHL Airways Inc.
> Infrastructure Technology & Services
> (773)-462-9758
> 24/7 Helpdesk 1-800-434-5767



-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to