CrazyEngineers
  • hbk
    hbk

    MemberJul 18, 2008

    populating drop down from MySQL

    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
Howdy guest!
Dear guest, you must be logged-in to participate on CrazyEngineers. We would love to have you as a member of our community. Consider creating an account or login.
Replies
  • bayazidahmed

    MemberJul 21, 2008

    using PHP?
    Are you sure? This action cannot be undone.
    Cancel
  • hbk

    MemberJul 21, 2008

    yes.... PHP = frontend, MySQL = backend...
    Are you sure? This action cannot be undone.
    Cancel
  • bayazidahmed

    MemberJul 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>
    Are you sure? This action cannot be undone.
    Cancel
Home Channels Search Login Register