I'm trying to figure out a way to add /edit/view locations per attorney in a database. I plan to include a link on teh attorney profile to "Add Locations" to show which locations the attorney practices.
I tried creating a custom SQL query as follows...
select * from locations
INNER JOIN attorneys_by_locations ON locations.location_id = attorneys_by_locations.location_id
where attorney_id =" & attorney_id
The attorneys_by_locations table includes 2 fields... attorney_id & location_id only.
I need to make the sql query dynamic based on the attorny_id which can be fed from the attorney profile section. How do I pass the attorney_id to this query? I also need to be able to let them add/delete the locations, too.
Thanks for your direction...
-LWTrumpet