I have sucessfully mad a connection to my DB and had it return results. The problem is I count through the result set using a for loop. The reult set will return the correct number of rows for what the Select statement should have, but only the first result's value shows up. Here is the code:
$myDB = mysql_select_db($db, $connect);
$query = mysql_query("select assignment from " . $table . " where instructor = '" . $instructor . "' and endDate > '" . $theDate . "'", $connect);
$numRows = mysql_num_rows($query);
//get the result for row numbered i
$thisResult = mysql_fetch_row($query);
//create all the options in the select menu
for($i = 0; $i < $numRows; $i++)
{
?>
<? print($thisResult) ?>
<option value="<? print($thisResult[$i]);?>"><? print($thisResult[$i]);?></option>
<?
}
?>
</select>
However this is what it returns in HTML:
<input type="hidden" name="action" value="upload_file">
<b>Assignment:</b><select name="assignment">
Array <option value="1">1</option>
Array <option value=""></option>
Array <option value=""></option>
Array <option value=""></option>
Array <option value=""></option>
Array <option value=""></option>
Array <option value=""></option>
Array <option value=""></option>
Array <option value=""></option>
Array <option value=""></option>
Array <option value=""></option>
Array <option value=""></option>
Array <option value=""></option>
</select>
There are 13 entries that should be returned and the array has 13 values, but only the first provides the actual value. What am I missing?
Thank you all for your help.