Hi all! I'm quite new with php, I'm having a very weird problem.
I've created a form like this :
<form name="year_search_form" method="get" action="results_by_year.php">
<select name="select_year" id="select_year">
<?php
$num_rows = mysql_num_rows($result);
for ($count = 0; $count < $num_rows; $count++) {
$line = mysql_fetch_array($result);
print ("<OPTION value=".$line['year'].">".$line['year']."</OPTION>");}
?>
</select>
<input name="submit" type="submit" class="search_button" value="Search">
</form>
unfortunately I don't get any item in the menu...
The connection with the DB and the query is well done since making a simple echo like this one works perfectly:
$num_rows = mysql_num_rows($result);
for ($count = 0; $count < $num_rows; $count++) {
$line = mysql_fetch_array($result);
print ($line['year']."<br>");
}
What am I doing wrong? :bemused:
Thank you!