Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Aug 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation call from databse

    i have some data for example :

    data_name value
    place USA
    place UK
    place RUSIA
    place CHINA
    place JAPAN

    so how i can call from database this data into select, radio and check box.

    for example: place: <select name=place>
    <option value=USA>USA</option>
    <option value=USA>USA</option>
    <option value=USA>USA</option>

    and more ....

  • #2
    New Coder
    Join Date
    Feb 2005
    Posts
    40
    Thanks
    0
    Thanked 0 Times in 0 Posts
    well you need to query your db, and then loop in your results and create the options for the select ?
    think that there is no other way, so you have to do it. No magic here

  • #3
    Super Moderator guelphdad's Avatar
    Join Date
    Mar 2006
    Location
    St. Catharines, Ontario Canada
    Posts
    2,631
    Thanks
    4
    Thanked 147 Times in 138 Posts
    Please do not post the same questions in multiple forums. The one in mysql has been deleted so all your answers will end up in one thread.

  • #4
    Regular Coder
    Join Date
    Mar 2005
    Location
    Pakistan
    Posts
    207
    Thanks
    0
    Thanked 0 Times in 0 Posts
    # to display data in select box

    $data = $dblink->getTableFromDB("select * from oes_courses");

    <select name="student_course" class="selectbox">
    <option>Select...</option>
    <?
    $i = 0;
    while($data[$i])
    {
    ?>
    <option><? echo $data[$i]['courseName']; ?></option>
    <?
    $i++;
    }
    ?>
    </select>
    God helps those who help others.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •