diff --git a/ThinkPHP/Library/Think/Db/Driver.class.php b/ThinkPHP/Library/Think/Db/Driver.class.php index dc45c1162..ee5ab1b01 100644 --- a/ThinkPHP/Library/Think/Db/Driver.class.php +++ b/ThinkPHP/Library/Think/Db/Driver.class.php @@ -967,9 +967,11 @@ public function insertAll($dataSet, $options = array(), $replace = false) } } } - $values[] = 'SELECT ' . implode(',', $value); +// $values[] = 'SELECT ' . implode(',', $value); + $values[] = '('.implode(',', $value).')'; } - $sql = 'INSERT INTO ' . $this->parseTable($options['table']) . ' (' . implode(',', $fields) . ') ' . implode(' UNION ALL ', $values); + $sql = 'INSERT INTO '.$this->parseTable($options['table']).' ('.implode(',', $fields).') values'.implode(',',$values); +// $sql = 'INSERT INTO ' . $this->parseTable($options['table']) . ' (' . implode(',', $fields) . ') ' . implode(' UNION ALL ', $values); $sql .= $this->parseComment(!empty($options['comment']) ? $options['comment'] : ''); return $this->execute($sql, !empty($options['fetch_sql']) ? true : false); }