Which is the best way to perform multi insertion into a table using custom code in drupal7.
$segment[] = array('name' => 'test)
$query = db_insert(TABLE_NAME_SEGMENT);
$query->fields( array('name') );
foreach($segment as $value)
$query->values($value);
$query->execute()
finally,I got the solution for it.I don't whether it good or bad