I have this 2 tables:
Code: Select all
tbl_order: orderId(PK),orderDate,shippedDate,status,comment,customerId(FK);
tbl_customer: custometId(PK),firstName,lastName...
i want to insert into tbl_order the customerId that is in the tbl_customer and the orderDate that the user is filling in the form.
i started by copying from the table like this:
Code: Select all
INSERT INTO tbl_order (customerId)
SELECT customerId FROM tbl_customer order by customerId desc limit 1
like this?
Code: Select all
INSERT INTO tbl_order (orderDate) VALUES NOW()
please help