populating drop down from MySQL

hbk

hbk

@hbk-UY6MQq Oct 25, 2024
hi guys.

i hav this drop down menu, which i need to populate with data from one column of a particular table of MySQL dbase.

i hav read a lot on this, but have not been able to come up wid any code.
any and all help in this regard will be greatly appreciated.

thx a ton.

Replies

Welcome, guest

Join CrazyEngineers to reply, ask questions, and participate in conversations.

CrazyEngineers powered by Jatra Community Platform

  • bayazidahmed

    bayazidahmed

    @bayazidahmed-qg0JR9 Jul 21, 2008

    using PHP?
  • hbk

    hbk

    @hbk-UY6MQq Jul 21, 2008

    yes.... PHP = frontend, MySQL = backend...
  • bayazidahmed

    bayazidahmed

    @bayazidahmed-qg0JR9 Jul 21, 2008

    i am supposing that u know how to create a databse connection using php. and u have the required field from the table in a resource. If you dont then tell me.

    <SELECT NAME="someName">
    <?PHP
    while($row = mysql_fetch_array($resource, MYSQL_ASSOC))
    {
    ?>
    <OPTION VALUE=<?PHP echo $row['field']; ?>><?PHP echo $row['field']; ?>
    <?PHP
    }
    ?>
    </SELECT>