Hi there:)

I use odbc so you'll have to change your functions if you're using mysql

//connect to db
$connectionToDB = odbc_connect("cdconsultant", "joecon", "joecon");

//create query statement
$sqlr = "SELECT DISTINCT category FROM CONSULTANT ORDER BY category" ;
//execute the sql statement (query) on the connection made
$resultset = odbc_do($connectionToDB, $sqlr);

print "<form name='myform' method='get' action='processingpage.php'><select
//loop through the category field and dump into select box
$category = odbc_result($resultset,1);
print "<option value='$category'>$category</option>";
print "</select><font face='Verdana, Arial, Helvetica, sans-serif' size='2'

print "<input type='submit' name='Submit3' value='Search'>";
print "</form>";

// close the connection

Hope this helps, Joe :)

Alvin Ang <[EMAIL PROTECTED]> wrote in message
> Hi there,
> I was wondering if anyone would be kind enough to show me how to select a
> field from a table in mysql and display it in a drop-down combo box?
> I am trying to show my users a list of all the parts from a table so that
> they can edit or delete it.
> Thanks!
> Alvin

PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to