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? 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. 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>"; } 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 Link to comment https://forums.phpfreaks.com/topic/70230-array/#findComment-352755 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.