Dear Experts,
I hope I did the best in trying to explain what I want in the question title. Let me give an exact description of the problem.
I have a database with some tables that are related with an Id field. What I am trying to achive is this:
I have a search page with N select fields in which the user can select a filter for the sql query that is to run in order to bring back results.
For example lets say I have these 4 select fields:
age, job,gender,specialization.
In the database I have a table USER defined as
USER_TABLE:
ID,Year_of_birth,name,gend
er
a table USER_JOB:
JOB_ID,,job_name,PARENT_ID
(Is the ID of the USER TABLE)
a SPECIALIZATTION table as:
SPECIALIZATION_ID_speciali
zation_nam
e,JOB_ID(i
s the JOB_ID of the USER_JOB table).
All fields in capital are primary keys.
What I want to do is store all the selections the user selects from the select boxes in a session array and display the results on the same page using the appropriate filters.
That is, The user arrives on the search page. He can select from any of the four select boxes and so the sql query is filtered with this selection. Lets say it is the age select box. Then the user arrives on the same page with the results filtered as he selected from the age select box. He then is able to select any value from any other select box or again from the age select box and get the appropriate results once more.
I want to keep these results in a session array since I want to have a paging capability on this page.
I know a way of doing it is checking which sessions variables are set and which are not and then wirting the appropriate sql query, but if I have like 10 select boxes I will need numerous sql queries.
I want a general rule that will constract the sql query every time the user selects something from the select boxes.
I hope I explained it well...
If any one wants any clarification please ask me to do so,
Thanks In Advance
Start Free Trial