MySQL Single插入来自post数据阵列的多行

I have search but dont see any answer or example that fits mine code. I am pretty new to MySQL/PHP, so I might not understand the answers I have looked at. I have a web page that posts data over that I want to use just one insert. This is what I have so far for the insert:

    $statement1 = $link->prepare("INSERT INTO collection_items(collection_list_id, collection_item_number, username_id, collection_item_title, collection_item_text, created_date)
   VALUES(:collection_list_id, :collection_item_number,  :username_id, :collection_item_title, :collection_item_text, now())");
$statement1->execute(array(
   "collection_list_id" => $last_id,
    "collection_item_number" => "1",
    "username_id" => $user_number,
    "collection_item_title" => $collection_item_title_1,
    "collection_item_text" => $collection_item_text_1
),
(
   "collection_list_id" => $last_id,
    "collection_item_number" => "2",
    "username_id" => $user_number,
    "collection_item_title" => $collection_item_title_2,
    "collection_item_text" => $collection_item_text_2
));

If I drop the last set of data it works just fine for one row. I have about 20 twenty rows of data from the page post. TIA

This is what I have, but can't get it to work. I'v shown more code to help.

$form = $_POST;
$collection_item_title_1 = $form[ 'number1' ];
$collection_item_text_1 = $form[ 'comment1' ];
$collection_item_title_2 = $form[ 'number2' ];
$collection_item_text_2 = $form[ 'comment2' ];

$last_id = $link->lastInsertId();
$q= $link->query("SELECT id FROM sitelok WHERE Username='$slusername'");
$user_number = $q->fetchColumn();

$collection_item_titles = array($collection_item_title_1, $collection_item_text_1, $collection_item_title_2, $collection_item_text_2);

$statement1 = $link->prepare("INSERT INTO collection_items(collection_list_id, collection_item_number, username_id, collection_item_title, collection_item_text, created_date)
   VALUES(:collection_list_id, :collection_item_number,  :username_id, :collection_item_title, :collection_item_text, now())");
    for ($i = 0; $i < size($collection_item_titles); $i++)
    $statement1->execute(array(
   "collection_list_id" => $last_id,
    "collection_item_number" => "$i",
    "username_id" => $user_number,
    "collection_item_title" => $collection_item_title[$i],
    "collection_item_text" => $collection_item_text[$i]
));

You could create an array and loop through the data and instead of having your data in separate variables ($collection_item_title_1, $collection_item_title_2) you could do something such as $collection_item_titles[] then loop through as such:

    statement1 = $link->prepare("INSERT INTO collection_items(collection_list_id, collection_item_number, username_id, collection_item_title, collection_item_text, created_date)
   VALUES(:collection_list_id, :collection_item_number,  :username_id, :collection_item_title, :collection_item_text, now())");
    for ($i = 0; $i < size($collection_item_titles); $i++)
    $statement1->execute(array(
   "collection_list_id" => $last_id,
    "collection_item_number" => "$i",
    "username_id" => $user_number,
    "collection_item_title" => $collection_item_title[$i],
    "collection_item_text" => $collection_item_text[$i]
);

You can't pass more then 1 argument to execute You can either insert values in a foreach loop or create a query with hundreds of placeholders.

I think first way is better, for example:

$values = array();    // your inserted values array here
$statement1 = $link->prepare("INSERT INTO collection_items(collection_list_id, collection_item_number, username_id, collection_item_title, collection_item_text, created_date) VALUES(:collection_list_id, :collection_item_number,  :username_id, :collection_item_title, :collection_item_text, now())");
foreach ($values as $v) {
    $statement1->execute($v);
}