如何使用单次执行处理多次插入 table

How to process multi insertion into a table using single excution

在 drupal7 中使用自定义代码向 table 执行多重插入的最佳方式是什么。

$segment[] = array('name' => 'test)
$query = db_insert(TABLE_NAME_SEGMENT);
$query->fields( array('name') );
foreach($segment as $value) 
$query->values($value);
$query->execute()

终于得到了it.I的解决方案,不知道是好是坏