If your database table has these fields:
mytable
======
id (auto-incrementing integer)
first_name
last_name
To add say 2 new rows from an array, say:
$people[0]['first'] = "Joe";
$people[0]['last'] = "Bloggs";
$people[1]['first'] = "John";
$people[1]['last'] = "Doe";
You have to build a string which, as r937 says looks like this:
insert into mytable (first_name, last_name)
values
('Joe', 'Bloggs'),
('John','Doe');
So that is what you have to get PHP to do for you.
You should echo the resulting string out onto the screen as you go, to check it against what you think it should be AND to then paste it into your database to make sure it really is a valid sql statement.
Bear in mind, if you have other columns in the target table without a default value, and you do not set one, this will cause an sql error.
If your id (in the above example table) is not of the kind “auto-increment” then it will cause an sql error.
Any other typo or syntax error on your part could cause an sql error.
With an auto-incrementing field, this will also work:
insert into mytable (id, first_name, last_name)
values
(0, 'Joe', 'Bloggs'),
(0, 'John','Doe');