in reply to array as mysql db rows

Some ready to use solutions to your problem are available at DBI Recipes.

Check especially the section titled "Inserting a list of lists."