i'm trying to print out values from a table into a drop down box, but my code doesnt seem to work. when i test it, there are no values in the drop down box.
if someone could find the problem, that would be great.
<form name="add_sub_section" method="post" action="<?php echo $_SERVER['../PHP_SELF']; ?>">
Sub Section Name <input type="text" name="sub_section_title" maxlength="200" /><br/><br/>
Sub Section desc <textarea name="sub_section_desc" rows="4" columns="30" /></textarea><br/><br/>
SECTION
<?php
$list = "SELECT section_title FROM section_main";
echo "<select name='section_title'>";
while ($a = mysql_fetch_row($list)) {
for ($j = 0; $j < mysql_num_fields($list); $j++) {
echo "<option value=". $a[$j] . ">". $a[$j] . "</option>";
}
}
echo "</select>";
?>
<br/><br/>
<input type="submit" name="submit" value="Add Section"/>
</form>
the connection to the table works, so i havnt put that code in.
there's no formatting for the html yet, i just want to get the php working first
Thanks