I have a form in my search.php page and want to know how to search on more than one field in my Mysql Database to give me the result.
This is my form for searching one field:
<form action="results.php" method="post">
Search: <select name="searchtype">
<option value="date">Date</option>
<option value="wk no.">Wk #</option>
<option value="year">Year</option>
<option value="artist">Artist</option>
<option value="title">Title</option>
</select> <input name="searchterm" type="text">
<INPUT type=image src="search.gif" value="Search"></div>
</form>
The thing is I wish to search on both the wk no. field and theyear field to give the result I want.
The think is that the Year is on multiple records (about 50 records) the Wk No. is the same on only 10 records in the database then the Wk No. changes with the Year staying the same.
This means that if I can search on both the Year and Wk No. it would give me the 10 records that match both criteria.
If I search on just the Year it gives me all 50 records for the year regardless of Wk No.
Or if I search on Wk No. it gives me all the records with the same WK No. in all the different years.
So if anyone can please amend my form code to do this it would be very much appreciated.