1$sql = array();
2foreach( $data as $row ) {
3 $sql[] = '("'.mysql_real_escape_string($row['text']).'", '.$row['category_id'].')';
4}
5mysql_query('INSERT INTO table (text, category) VALUES '.implode(',', $sql));
6
1$values = array();
2foreach($data as $row ) {
3 $values[] = '('.$row['id'].', "'.mysql_real_escape_string($row['name']).'")';
4}
5mysql_query('INSERT INTO table (id, name) VALUES '.implode(',', $sql));