/** * Creates an INSERT SQL-statement for $table with multiple rows. * This method will create multiple INSERT queries concatenated with ';' * * @param string Table name * @param array Field names * @param array Table rows. Each row should be an array with field values mapping to $fields * @param string/array See fullQuoteArray() * @return array Full SQL query for INSERT as array of strings (unless $fields_values does not contain any elements in which case it will be FALSE). If BLOB fields will be affected and one is not running the native type, an array will be returned for each row, where 0 => plain SQL, 1 => fieldname/value pairs of BLOB fields. */ public function INSERTmultipleRows($table, array $fields, array $rows, $no_quote_fields = FALSE) { if ((string) $this->handlerCfg[$this->lastHandlerKey]['type'] === 'native') { return parent::INSERTmultipleRows($table, $fields, $rows, $no_quote_fields); } $result = array(); foreach ($rows as $row) { $fields_values = array(); foreach ($fields as $key => $value) { $fields_values[$value] = $row[$key]; } $rowQuery = $this->INSERTquery($table, $fields_values, $no_quote_fields); if (is_array($rowQuery)) { $result[] = $rowQuery; } else { $result[][0] = $rowQuery; } } return $result; }