Skip to content
Advertisement

PDO insert array in array

i’m confused … I am encountering a tiny issue that drives me crazy. I have arrays in an array which i’d like to insert into an SQL table. My issue is that i don’t figure out how to insert arrays in an array …

The arrays: Array ( [1] => Array ( [diploma] => Master [institut] => IAE ) [2] => Array ( [diploma] => Licence [institut] => Université ) )

Any piece of advice is welcome 🙂 Thanks a lot from France !

JavaScript

Advertisement

Answer

You need to loop over your multidimensional array and use named placeholders so the values match up.

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement