Hello,
I am making a search page for a site, and want to search on various form fields.
The fields on the search page are, 'username', 'dates between (date 1 and date 2)', module number'.
The search will need to search accross 8 tables if no module number is selected, all containing results (module1 - module8).
Each table will be layed out the same, with a username, then a number of fields for each question, then a percentage field, and a date field.
A search for example could be when a username is searched for. Or between 2 dates.
This would then bring me a page which lists all relevant exams for the 8 modules if they match the search criteria.
The other type of search i want is a username search.
I am wondering if i should make them separate forms on my search page or keep the query as one?
For example if i was doing a query ...eg.."WHERE username LIKE "" AND module LIKE "".........
Would the above bring forget the username search if the person left that search field blank?
Also i thought i could just have 8 queries on my results page that checked each table.....but how would i perform only one of those queries if one of queries was chosen, or all of them if the modules were not specified.
To sum up the areas i want help and answers with:
Should i have 1 query or 8 (one for each module)
If the person searching leaves a field empty, will my query just continue not using that field as a search restriction?
should i have separate forms for each type of search?
This is first time ive built a search function, and cant really understand other threads about it 🙂
any help would be really great.
Thx, Elliott