Insert Array Value to Mysql/Php

Hi guys, please see below.

$a=array (100,200,300,x,y,z);

I want this six data to be insert in mysql table in six row, repeatedly from the array.

mysql-tabel

ID–SIZE
1–100
2–200
3–300
4–X
5–Y
6–Z
7–100
8–200
9–300
10–X
11–Y
12–Z



How can I do this?

<?php
// establish database connection with PDO
// prepare an sql statement with your values
// foreach() over your array
// bind params and execute statement

just fill up with code.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.