darryncooke
Technical User
I have little (to maybe no) experience in sql.
I have a sql string that i want to create fora website using php where i have 3 criteria. Not all 3 will be selected.
lets say they are A, B, and C.
I can create a sql statement that pulls the URL variable using GET if A, B and C are specified. However if say only A is selected I want B and C to select ALL options. Is there a global sql (I know asterisk but that only works on slect all clums from what I have seen when I tried it) so say
SELECT * FROM table
WHERE column1 = A(or all) AND column2 = B(or all) AND column3 = C(or all)
where or all is the default if there is NO included url parameter specified for that variable.
Darryn Cooke
| The New Orange County Graphic designer and Marketing and Advertising Consultant
| Marketing and Advertising blog
I have a sql string that i want to create fora website using php where i have 3 criteria. Not all 3 will be selected.
lets say they are A, B, and C.
I can create a sql statement that pulls the URL variable using GET if A, B and C are specified. However if say only A is selected I want B and C to select ALL options. Is there a global sql (I know asterisk but that only works on slect all clums from what I have seen when I tried it) so say
SELECT * FROM table
WHERE column1 = A(or all) AND column2 = B(or all) AND column3 = C(or all)
where or all is the default if there is NO included url parameter specified for that variable.
Darryn Cooke
| The New Orange County Graphic designer and Marketing and Advertising Consultant
| Marketing and Advertising blog