Table: members
Name ID Skills
John 1 ASP
Steff 2 PHP
Steff 2 ASP
David 3 PHP
Bob 4 PERL
input search values, $inputid, $inputskills
SELECT * FROM members WHERE ID='$inputid' AND SKILL='$inputskills'
So if $inputid=1, $inputskills=PHP,
nothing!!!
So if $inputid=1, $inputskills=ASP
John 1 ASP
So if $inputid=2, $inputskills=PHP,
Steff 2 PHP
BUT, what i also want here is, say ASP is a default language.
if $inputid is matched, $inputskills is not matched, but this record has the ASP as the skills, which is the default one i pre-set, i still want that record in the result row.
So if $inputid=2, $inputskills=PHP,
Steff 2 PHP
(id matched, skills matched, so we don't have to bring in the other record, even id 2 also has the default skill ASP)
So if $inputid=1, $inputskills=PHP,
John 1 ASP
(because id matched, ,skill not match but this matched record also has the skills as the default one ASP.)
So if $inputid=4, $inputskills=PHP,
nothing
(because id matched, skill not match and matched record does not have the default skill, ASP)
How to write this SQL?