1

I have a variable with the contents of the array is as below

$dataRoles = [
  0 => [
   'data1',
   'data2',
   'data3'
 ],

  1 => [
  'data4',
  'data5'
 ]
]

and I have 2 tables table role_0, and role_1.

How to insert a data array 0 => '....' to the table role_0 and array 1 => '....' to the table role_1

1 Answer 1

0

It's impossible to make insert into 2 different tables. It's only possible to insert into 1 table but many records using bulk insert e.g:

insert into table (fld1, fld2) values ("val1", "val2"), ("val3", "val4"), ... 
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.