#1
  1. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2012
    Posts
    204
    Rep Power
    3

    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..

    Code:
    INSERT INTO customerLists 
    SELECT customers.id FROM customers
    How can i combine this with a value of my own
    I tried..

    Code:
    INSERT INTO customerLists VALUES( :myValue, 
    SELECT customers.id FROM customers)
    Any ideas? thanks!
  2. #2
  3. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2012
    Posts
    204
    Rep Power
    3
    I already found the solution

    INSERT INTO werknemerlijsten
    SELECT w.id, : ownvalue FROM werknemers

IMN logo majestic logo threadwatch logo seochat tools logo