Before inserting this as a bug to the google code, I want to make sure that it does not work as intended.

CDbCommandBuilder class createInsertCommand($table,$data) method inserts through the data parameter, which accepts key=>value pairs, where key is the column name, and value is the data to be added.

What if i want to insert multiple rows? I tried using an array for the value par but it does not work. And the code shows me that it can not work:

$sql=“INSERT INTO {$table->rawName} (”.implode(’, ‘,$fields).’) VALUES (’.implode(’, ‘,$placeholders).’)’;

Although ‘VALUES’ keyword is used for inserting multiple rows, $placeholdes should be seperated by parentheses, like

INSERT INTO tbl_name (a,b,c) VALUES(1,2,3),(4,5,6),(7,8,9);

I believe a better signature for the method would be:


where columns is the column array, and data is a possible 2 dimensional array which is the pure data where the indexes match the column number, like

columns: array(‘postID’,‘commentID’)

data: array( array(1,2), array(2,3))