"e;SELECT c.*, b.business_name FROM customer_contact_info c, business b WHERE c.$srtMe
LIKE'%$question%' AND c.business_id = b.business_id ORDER BY $srtMe ASC LIMIT $page_a,$page_b"e;
the only time this doesn't work is when I'm seaching a business name since the business names are in the business table and not the cusotmer table. i made this query which I thought would work.
SELECT c.*, b.business_name FROM customer_contact_info c, business b WHERE b.$srtMe
LIKE'%$question%' AND c.business_id = b.business_id ORDER BY $srtMe ASC LIMIT $page_a,$page_b"e;
the query returns results, but not acurate ones.
the customer table references the business table at business_id. can anyone tell me what I'm doing wrong or how to fix this.
Actually it is two tables. the business table and the contact table. This is so there can be multiple contacts at each business. the contacts table references the business table at business_id.
Actually the system is set up so that you have to have a business. I don't know how much that matters, but I 've been trying alsorts of different inner join's and none of them worked for me I tried a left, right , and outer join none of them worked either.
"e;SELECT customer_contact_info.*, business.business_name FROM customer_contact_info
INNER JOIN business.business_name USING (business_id) WHERE business.business_name LIKE'%$question% ORDER BY business_name ASC LIMIT
$page_a,$page_b"e;