I have read up on the web but I could use a nice description of what I need to do to preform this. Or if it can even be done.
I have 4 tables: Marketers, Customers, FollowUp and PeopleInfo
They all have their own keys and fields but are linked by the userID column.
Now the thing is.... PeopleInfo has every userID and a full list of valid userIDs.
Marketers has only those users who are marketers.
Customers has only those users who are customers.
FollowUp has more generic questions that extend the PeopleInfo Table.
It is possible for the userID to only exsit in the PeopleInfo.
It is also possible for the userID to be in FollowUp and People Info.
It is also possible for it to be in Marketer, FollowUp and PeopleInfo OR Customers, FollowUp and PeopleInfo but never all 4 together.
Now what I would like to do is create a search where the person searching can select a field from a drop down (value passed as tableName.field) and enter a value then hit submit. Then MySQL would be able to get the desired field and throw me all the PeopleInfo for the found person. The search page would also have several search drop downs with AND/OR clauses.
For example:
the user selects Marketers.yearsOfMarketing = '4' OR Customers.yearsOfBuying = '3' ---> this would return the PeopleInfo of the userID stored in the respected table (Marketers or Customers). Make sense?
Should I Join, Select a lot or what?
-alocurto
I have 4 tables: Marketers, Customers, FollowUp and PeopleInfo
They all have their own keys and fields but are linked by the userID column.
Now the thing is.... PeopleInfo has every userID and a full list of valid userIDs.
Marketers has only those users who are marketers.
Customers has only those users who are customers.
FollowUp has more generic questions that extend the PeopleInfo Table.
It is possible for the userID to only exsit in the PeopleInfo.
It is also possible for the userID to be in FollowUp and People Info.
It is also possible for it to be in Marketer, FollowUp and PeopleInfo OR Customers, FollowUp and PeopleInfo but never all 4 together.
Now what I would like to do is create a search where the person searching can select a field from a drop down (value passed as tableName.field) and enter a value then hit submit. Then MySQL would be able to get the desired field and throw me all the PeopleInfo for the found person. The search page would also have several search drop downs with AND/OR clauses.
For example:
the user selects Marketers.yearsOfMarketing = '4' OR Customers.yearsOfBuying = '3' ---> this would return the PeopleInfo of the userID stored in the respected table (Marketers or Customers). Make sense?
Should I Join, Select a lot or what?
-alocurto
