unidox Posted September 22, 2007 Share Posted September 22, 2007 My code: require_once ("files/roster.php"); $selecta = "Member&Co-Leader&Leader&Recruit"; $selectb = mysql_fetch_array(MYSQL_QUERY("SELECT * FROM cp_divisions ORDER BY division ASC")); The select b goes in a drop down, and I would like it to drop as many divisions are in the db, but theres only 1 and it says array. How do I echo the right thing? Quote Link to comment https://forums.phpfreaks.com/topic/70230-array/ Share on other sites More sharing options...
pocobueno1388 Posted September 22, 2007 Share Posted September 22, 2007 Try mysql_fetch_assoc() instead of array. Show the code to your drop-down. Quote Link to comment https://forums.phpfreaks.com/topic/70230-array/#findComment-352733 Share on other sites More sharing options...
unidox Posted September 22, 2007 Author Share Posted September 22, 2007 This is my drop down code: if ($fieldtype[$i] == "select") { echo "<select name=\"" . $field[$i] . "\">"; $options = explode("&",$selectb); for ($o = 0; $o < count($options); $o++) { echo "<option value=\"" . $options[$o] . "\""; if ($mysql_values != '') { if ($mysql[$i] == $options[$o]) { echo " selected"; } } echo ">" . $options[$o] . "</option>"; } Quote Link to comment https://forums.phpfreaks.com/topic/70230-array/#findComment-352743 Share on other sites More sharing options...
unidox Posted September 22, 2007 Author Share Posted September 22, 2007 bump Quote Link to comment https://forums.phpfreaks.com/topic/70230-array/#findComment-352755 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.