Jump to content

[SOLVED] WHERE ?


Clinton

Recommended Posts

Let's say I've got three fields that keep track of a persons skills.

 

These are Bobs skills...

 

Field 1 is his primary skill, say a Carpenter.

Field 2 is his secondary skill, say a Hair Dresser.

Field 3 is his tertiary skill, say a Window Washer.

 

These are Joes skills...

 

Field 1 is his primary skill, say a Hair Dresser.

Field 2 is his secondary skill, say a Carpenter.

Field 3 is his tertiary skill, say a Window Washer.

 

Now lets say I wanted to pull up all the people who are qualified to be a carpenter. How do I do this?

 

Right now I've got:

 

SELECT * FROM thelist WHERE pskill = 'carpentry'

 

But this only lists the ones who have the primary skill of carpentry.

 

If I do:

 

SELECT * FROM thelist WHERE pskill = 'carpentry' AND sskill = 'carpentry' 

 

then it leaves out anybody who just has the primary skill (or secondary if I include the third).

 

How do I make it so it finds all carpenters in any of those three fields without excluding everyone if one doesn't have it?

Link to comment
https://forums.phpfreaks.com/topic/139453-solved-where/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.