I am trying to pull all the field from the properties table, but no fields from the users table where the currently logged in user has the same company_name as the user that is attached to the property. I have a field called userid in the properties table which relates to the id field in the users table. company_name doesn't exist in the properties table. Here is my current sql:
LJ Wilson
My personal saying - Just remember, it can always get worse, and usually will.
Code:
SELECT * FROM pmr_properties p, pmr_users u WHERE p.sold IS NULL OR p.sold = 0 AND p.active = 1 AND p.userid=u.id AND u.company_name = 'Coldwell Banker Tatman Realtors'
LJ Wilson
My personal saying - Just remember, it can always get worse, and usually will.