Quantcast
Channel: Adobe Community: Message List
Viewing all articles
Browse latest Browse all 142955

Syntax for dynamic dropdown in form

$
0
0

I have a simple database structure with a table for venues and events.

 

I am trying to add a select drop down in my form to add a new event which lists the venues, and inserts the VenueID into a field in the Events table.

 

I have this, which I think is pretty close, but its not pulling anything through:

 

<select name="VenueID">

    <?php

    $sql = "SELECT VenueID, Venue FROM Venues ORDER BY Venue ASC";

    $result = mysql_query($sql);

    while ($row = mysql_fetch_array($result)) {

    echo '<option value="' . $row['VenueID'] . '">' . $row['Venue'] . '</option>';

    }

    ?>

</select>

 

Thanks for any pointers.


Viewing all articles
Browse latest Browse all 142955

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>