0

I'm getting two form datas as array .I want to insert those data in my table.

arrays

> var_dump($name);
array(3) { [0]=> string(5) "allen" [1]=> string(4) "dave" [2]=> string(3) "len" }

> var_dump($designation) ;
array(3) { [0]=> string(7) "analyst" [1]=> string(8) "designer" [2]=> string(2) "pm" }

below is my table insert query

foreach ($name as $list) {
    $sig = new Names;
    $sig->name =$list;
    $sig->designation =?;
    $sig->festival = $id;
    $sig->save();
}

how to insert desgination array ? pls advice

Matteo Piano
  • 392
  • 4
  • 12
  • 1
    See: http://stackoverflow.com/q/32061254 – Rizier123 Feb 04 '17 at 14:09
  • @Rizier123 : Thanks It helps :) –  Feb 04 '17 at 14:22
  • 1
    Possible duplicate of [Two arrays in foreach loop](http://stackoverflow.com/questions/4480803/two-arrays-in-foreach-loop) – Stephen Rauch Feb 04 '17 at 16:07
  • Possible duplicate of [How can I loop through two arrays at once?](http://stackoverflow.com/questions/32061254/how-can-i-loop-through-two-arrays-at-once) – KARTHI SRV Feb 04 '17 at 16:23
  • @dil What is the status of this question? It appears that Rizier123's comment was helpful to you, and you may have also upvoted Stephen's suggested duplicate link. If you found your solution from a duplicate question, please delete your question and spare SO the unwanted bloat. If your question is unresolved, please update your question with any new details or attempts that you have made. – mickmackusa Mar 13 '17 at 11:41

0 Answers0