August 6th, 2013, 04:42 AM
Insert into.. Combining Select and own value?
I want to INSERT a group of persons in my table at the same time.. The table needs a 'list_id' and a 'customer_id'..
I tried inserting with a INSERT INTO SELECT. but then i can only insert fields from another table i need it combined with a $_POST value of mine..
How can i combine this with a value of my own
INSERT INTO customerLists
SELECT customers.id FROM customers
Any ideas? thanks!
INSERT INTO customerLists VALUES( :myValue,
SELECT customers.id FROM customers)
August 6th, 2013, 04:54 AM
I already found the solution
INSERT INTO werknemerlijsten
SELECT w.id, : ownvalue FROM werknemers