Hey all, here's my question. I have a query that gets info from two tables in my database. How do I access the data from the query? I know how to use the mysql_fetch_assoc() when the query in question only pulls information from a single table. How do I do the same thing for multiple tables and then insert the necessary data into my page? 😕
Here's my query
$query = "SELECT * FROM customers, service WHERE customers.id = service.cust_id AND service.active = 1 ORDER BY service.id DESC";
$result = mysql_query($query);
I have some fields that appear in both tables but are specific to that table. I still need to be able to access all the information for each table independently. Here are the structures for each:
Service:
id, cust_id, make, model, equipment, issue, tnotes, tcomments, status, lcost, pcost, entered, estimate, date_needed, modified, modified_by, active
Customers
id, fname, lname, address, city, state, zip, category, business, hphone, wphone, mphone, email, entered, modified, modified_by
Thanks in advance!