Jump to content

Array


unidox

Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.