SocomNegotiator Posted April 11, 2008 Share Posted April 11, 2008 Does anyone know why this does not work... <select name="name" id="name"> <option selected="selected"> </option> <? $sql2 = "SELECT * FROM teams ORDER BY name ASC"; $result2 = mysql_query($sql2); while($data2 = mysql_fetch_array($result2)) { $country = $data2['name']; echo "<option value='$country'>$country</option>"; } ?> </select> Link to comment https://forums.phpfreaks.com/topic/100591-solved-simple-php-problem/ Share on other sites More sharing options...
darkfreaks Posted April 11, 2008 Share Posted April 11, 2008 <?php $sql2 = "SELECT * FROM teams ORDER BY name ASC"; $result2 = mysql_query($sql2) or die(mysql_error()); while($data2 = mysql_fetch_array($result2)) { $country = $data2['name']; echo "<option value=$country>$country</option>"; } ?> Link to comment https://forums.phpfreaks.com/topic/100591-solved-simple-php-problem/#findComment-514464 Share on other sites More sharing options...
SocomNegotiator Posted April 11, 2008 Author Share Posted April 11, 2008 Hmmm...so no quotes around variable in the echo statement. I knew it was going to be something stupid Link to comment https://forums.phpfreaks.com/topic/100591-solved-simple-php-problem/#findComment-514814 Share on other sites More sharing options...
darkfreaks Posted April 11, 2008 Share Posted April 11, 2008 Please click Topic Solved Link to comment https://forums.phpfreaks.com/topic/100591-solved-simple-php-problem/#findComment-514827 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.