Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- Exporting from multiple tables in a db.
November 5, 2004, 1:11 am
rate this thread
database that has related information in different tables. I can extract the
info fine it's just getting it to match up where I'm having the issues. Is
this the time for the join command? Basically I have order_id that carries
into several tables. I need to extract that info that's related to each
$select = "SELECT * FROM orders, orders_products WHERE orders_status='2' AND
Re: Exporting from multiple tables in a db.
I'm not surprised. :-)
You should definitly brush up your SQL knowledge.
I assume what you actually mean is you have 2 tables called orders and
orders_products, orders contains (among other data) status and id and
orders_products contains id (and other data) and you want to do an
equi-join (join on equal id).
Then the SQL statement you are looking for is
SELECT * FROM orders O, orders_products P WHERE O.status = '2' AND O.id