I've got two tables that I'd like to search. Here is how I've got it set up:
There is a property table. Each property can have multiple names, with one name designated as the main name. So there is a property name table as well. But I want the user to be able to search by property names and the result to display as: Main Property Name a.k.a. Non-Main Property Name 1 a.k.a. Non-Main Property Name 2 I'm having problems doing this without multiple queries. Right now, I've got one query that searches the names. Then another query that takes the found property ID and finds that property. The property is displayed with the main property name. Then there is another query to find the aka's. I have to repeat this type of thing on the search results page as well for people and then people with multiple names. That makes 8 queries to display the search results. Plus more in the future as we add different options for searching the site. Is there a better way to do this? Can someone point me in the right direction?