A3aan Posted November 5, 2006 Share Posted November 5, 2006 Hi all,i'm trying to fill a drop down list from a function, but the list stays empty.Hope that you can help me out with this.Here's my code:[code]<?phprequire_once ('Connections/magicdb.php'); // db connectfunction showEdition() { $query = "SELECT edition_id, edition_name FROM editions ORDER BY edition_name" ; $result = mysql_query($query) or die(mysql_error()); while($row = mysql_fetch_assoc($result)){ echo "<option value='$row[edition_id]'>$row[edition_name]</option>\n"; }}?><form><select><?php echo showEdition(); ?></select></form>[/code]Thnx in advance Quote Link to comment Share on other sites More sharing options...
A3aan Posted November 5, 2006 Author Share Posted November 5, 2006 Pfff... made a newbie mistake ;Dforgot to select the db :o :-X Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.