Dynamic Menu initially select AND reset
Here is the code I am using for the dynamic menu:
<select name="S_year" id="S_year">
<option selected="selected" value="" <?php if (!(strcmp("", $row_rsPhotoYear['year']))) {echo "selected=\"selected\"";} ?>>Select Year</option>
<?php
do {
?><option value="<?php echo $row_rsPhotoYear['year']?>"<?php if (!(strcmp($row_rsPhotoYear['year'], $row_rsPhotoYear['year']))) {echo "selected=\"selected\"";} ?>><?php echo $row_rsPhotoYear['year']?></option>
<?php
} while ($row_rsPhotoYear = mysql_fetch_assoc($rsPhotoYear));
$rows = mysql_num_rows($rsPhotoYear);
if($rows > 0) {
mysql_data_seek($rsPhotoYear, 0);
$row_rsPhotoYear = mysql_fetch_assoc($rsPhotoYear);
}
?>
</select>
I want to show all records in the database from selected year.
Also the results are not resetting - once you search it does not seem to be resetting.
photogallery_Search.php