The forums have permanently moved to forum.kirupa.com. This forum will be kept around in read-only mode for archival purposes. To learn how to continue using your existing account on the new forums, check out this thread.


Results 1 to 3 of 3

Thread: PHP Form w/ multiple select options loaded from mysql database

  1. #1

    PHP Form w/ multiple select options loaded from mysql database

    Hey there
    Just wanted to know if someone could help me out here:

    A PHP form that enables people to submit an email form. The email form also has a multiple select list.

    Now here's the catch. The multiple select options have to be loaded from a mysql database?

    So I'm assuming there'll be some sort of 'loop' function here too <option value="">Option Value here</option> ?

    Can someone point me to a script that enables me to do this?

    Thanks

  2. #2
    First of all you need to query the database for the results, ie the options you want to display
    Then you need to disply the results in a while loop, then close the query, like this
    <?
    $query = mysql_query("SELECT * FROM blah")
    echo "<select name='blah_blah'>";
    while ($row=mysql_fetch_array($query)) {
    echo "<option>". $row['options']."</option>";
    }
    echo "</select>";
    ?>
    Like that but you have to replace the variable with what you need, kinda easy really but only if you've been told like I was.

  3. #3

    Any luck?

    Have you had any luck resolving your problem yet? If so, could you please let me know what you're findings were becauase I am having a similar problem.

    Thanks:
    -- Dan

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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

Home About kirupa.com Meet the Moderators Advertise

 Link to Us

 Credits

Copyright 1999 - 2012