I have 2 tables, members_outsidesales and am_insidesales. Members outsidesales contains first name, last name, login, territory id, and password.
am_outsidesales contains a bunch of fields one of which is territory id as well.
What I am trying to do is write a query that based on the users logged in territory id in members_outsidesales, display only the records with matching territory id's in am_outsidesales. I have tried many way to do this but have not been successful up to this point. Any help would be greatly appreciated! Here is what I have now that doesn't work:
$result = mysql_query("SELECT * FROM am_insidesales
WHERE territoryid='SESS_TERRITORY_ID'") or die(mysql_error());