i have this query:
$sql = "INSERT INTO orders(email, cod, qty, type, model, price)
SELECT email, cod, qty, type, model, price FROM cart
WHERE email='$login_user'";
this stores into ORDERS the values that i have in those columns in CART, but besides this i would like to store in these columns in ORDERS (address, zip_code, state) the values in the table USERS (address, zip_code, state).
i've tried everything but the problem is that i can't get the syntax right.
how can i insert into a table values by selecting them from 2 other tables??
thanks in advance!