Help with a query

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I can't figure this query out.

I want to pull data from 2 tables but using a primary key from one.

Here is what I think it should look like.

SELECT item_id, subtotal, quantity from shopping_cart WHERE order_id =
(SELECT order_id FROM orders WHERE session_id = session_id()) AND
customer_id = $customer_id;

-Jonathan




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux