original_string: protected function insert_chunk($table, array $chunk, array $columns) {
          $fieldssql = '('.implode(',', array_keys($columns)).')';
  
          $valuessql = '('.implode(',', array_fill(0, count($columns), '?')).')';
          $valuessql = implode(',', array_fill(0, count($chunk), $valuessql));
  
          $params = array();
          foreach ($chunk as $dataobject) {
              foreach ($columns as $field => $column) {
                  $params[] = $this->normalise_value($column, $dataobject[$field]);
              }
          }
  
          $sql = "INSERT INTO {$this->prefix}$table $fieldssql VALUES $valuessql";
  
          list($sql, $params, $type) = $this->fix_sql_params($sql, $params);
          $rawsql = $this->emulate_bound_params($sql, $params);
  
          $this->query_start($sql, $params, SQL_QUERY_INSERT);
          $result = $this->mysqli->query($rawsql);
          $this->query_end($result);
      }
code: protected function insert_chunk($table, array $chunk, array $columns) {
          $fieldssql = '('.implode(',', array_keys($columns)).')';
  
          $valuessql = '('.implode(',', array_fill(0, count($columns), '?')).')';
          $valuessql = implode(',', array_fill(0, count($chunk), $valuessql));
  
          $params = array();
          foreach ($chunk as $dataobject) {
              foreach ($columns as $field => $column) {
                  $params[] = $this->normalise_value($column, $dataobject[$field]);
              }
          }
  
          $sql = "INSERT INTO {$this->prefix}$table $fieldssql VALUES $valuessql";
  
          list($sql, $params, $type) = $this->fix_sql_params($sql, $params);
          $rawsql = $this->emulate_bound_params($sql, $params);
  
          $this->query_start($sql, $params, SQL_QUERY_INSERT);
          $result = $this->mysqli->query($rawsql);
          $this->query_end($result);
      }
code_tokens: protected function insert_chunk ( $ table , array $ chunk , array $ columns ) { $ fieldssql = '(' . implode ( ',' , array_keys ( $ columns ) ) . ')' ; $ valuessql = '(' . implode ( ',' , array_fill ( 0 , count ( $ columns ) , '?' ) ) . ')' ; $ valuessql = implode ( ',' , array_fill ( 0 , count ( $ chunk ) , $ valuessql ) ) ; $ params = array ( ) ; foreach ( $ chunk as $ dataobject ) { foreach ( $ columns as $ field => $ column ) { $ params [ ] = $ this -> normalise_value ( $ column , $ dataobject [ $ field ] ) ; } } $ sql = "INSERT INTO {$this->prefix}$table $fieldssql VALUES $valuessql" ; list ( $ sql , $ params , $ type ) = $ this -> fix_sql_params ( $ sql , $ params ) ; $ rawsql = $ this -> emulate_bound_params ( $ sql , $ params ) ; $ this -> query_start ( $ sql , $ params , SQL_QUERY_INSERT ) ; $ result = $ this -> mysqli -> query ( $ rawsql ) ; $ this -> query_end ( $ result ) ; }
docstring: Insert records in chunks.
  
  Note: can be used only from insert_records().
  
  @param string $table
  @param array $chunk
  @param database_column_info[] $columns
docstring_tokens: Insert records in chunks .