load data in to combobox from database

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • savanm
    New Member
    • Oct 2006
    • 85

    load data in to combobox from database

    Hi all,

    I have one doubt. How to load data from the databse in to combobox..

    I have a mysql table login

    two fields in the table namely user and password

    I want to load the list of user's into the combobox..

    Thanks

    Navas.M
  • mainul
    New Member
    • Sep 2006
    • 51

    #2
    Originally posted by savanm
    Hi all,

    I have one doubt. How to load data from the databse in to combobox..

    I have a mysql table login

    two fields in the table namely user and password

    I want to load the list of user's into the combobox..

    Thanks

    Navas.M
    Hi Navas,
    Try this out.

    [PHP]
    <? $name= mysql_query("se lect * from table_name"); ?>

    <select name="user" id="user">
    <? while($res= mysql_fetch_ass oc($name))
    { ?>
    <option>
    <? echo $res['table_field']?>
    </option>
    <? }?>
    </select>

    [/PHP]

    Best regards,
    Mainul

    Comment

    • savanm
      New Member
      • Oct 2006
      • 85

      #3
      Hi..

      It help to solve my problem

      Thanks Guy
      Navas

      Comment

      • samarulraj

        #4
        nice frd i got it

        Comment

        • samarulraj

          #5
          thank you friend works fine-------------------

          Comment

          Working...