I have a mysql table with fields of the form (id, contact_id, fruit, preference_no)
Id is auto-incrementing, contact_id, fruit and preference_no can take many values.
I want to insert many rows into this table. These rows all have fruit = 'apple' and preference_no = '7" but the value for contact_id is to to be drawn from a list of numbers ie contact_id in (523, 525, 526, 539,...)
So the first row to insert would be (523,'apple',7) and the second row would be (525,'apple', 7) etc
Is there a quick way to do this using MySQL?
Can I do something with parameters?
Eg Insert into table (contact_id, fruit, preference_no) select @param, 'apple', 7 where @param = (523,525,526,539,...)