Returns the generated 'insert' sql query

@param string $table
@param bool $reset
@return string
163979
public function getCompiledInsert(string $table, bool $reset=TRUE): string
	{
		return $this->_getCompile('insert', $table, $reset);
	}
1238301
function insert($table, $data) {
		$q = "INSERT INTO $table ";
		$v=''; $n='';
		foreach($data as $key=>$val) {
			$n .=" ".$this->encapsulate_column_name($key).", ";
			if(strtolower($val)=='null') {
				$v.="NULL, ";
			} elseif(strtolower($val)=='now()') {
				$v.="NOW(), ";
			} else {
				$v.= "'".$this->escape($val)."', ";
			}
		}
		$q .= "(". rtrim($n, ', ') .") VALUES (". rtrim($v, ', ') .");";
		return $this->query($q);
	}
1008575
protected function getInserts($table)
    {
        $db       = $this->db;
        $query    = $db->getQuery(true);
        $iterator = $db->getReader($query->select('*')->from($query->quoteName($table)))->getIterator();

        if (!count($iterator)) {
            return null;
        }

        $sql = [];

        foreach ($iterator as $data) {
            $data = (array) $data;

            $data = array_map(
                function ($d) use ($query) {
                    return $query->q($d) ?: 'NULL';
                },
                $data
            );

            $value = implode(', ', $data);

            $sql[] = (string) sprintf("INSERT `%s` VALUES (%s)", $table, $value);
        }

        return (string) implode(";\n", $sql);
    }
489279
public function insert($table = null, SqlInterface $database = null)
    {
        //if no table
        if (is_null($table)) {
            //if no default table either
            if (!$this->table) {
                //throw error
                throw SqlException::forTableNotSet();
            }

            $table = $this->table;
        }

        //if no database
        if (is_null($database)) {
            //and no default database
            if (!$this->database) {
                throw SqlException::forDatabaseNotSet();
            }

            $database = $this->database;
        }

        //get the meta data, the valid column values and whether is primary is set
        $meta = $this->getMeta($table, $database);
        $data = $this->getValidColumns(array_keys($meta[self::COLUMNS]));

        //we insert it
        $database->insertRow($table, $data);

        //only if we have 1 primary key
        if (count($meta[self::PRIMARY]) == 1) {
            //set the primary key
            $this->data[$meta[self::PRIMARY][0]] = $database->getLastInsertedId();
        }

        return $this;
    }
320636
public function insert_id($table = '')
    {
        if (!$this->db_connected || $this->db_mode == 'r') {
            return false;
        }

        if ($table) {
            // resolve table name
            $table = $this->table_name($table);
        }

        $id = $this->dbh->lastInsertId($table);

        return $id;
    }
448960
public function insertPDO($table, array $data = array())
    {
        if (count($data) === 0) {
            return false;
        }
        $q = "INSERT INTO `$table` ";
        $v = '';
        $n = '';

        foreach ($data as $key => $val) {
            $n .= "`$key`, ";
            if (strtolower($val) === 'now()') {
                $v .= 'NOW(), ';
                unset($data[$key]);
            } else {
                $v .= '?, ';
            }
        }
        $q .= '(' . rtrim($n, ', ') . ') VALUES (' . rtrim($v, ', ') . ');';
        try {
            $this->_queryId = self::$_linkId->prepare($q);

            $i = 1;
            foreach ($data as $key => $val) {
                $type = $this->getPDOConstantType($val);
                $this->_queryId->bindValue($i, $val, $type);
                ++$i;
            }
            $this->_queryId->execute();
            return self::$_linkId->lastInsertId();
        } catch (PDOException $e) {
            $this->_error = $e->getMessage();
            return false;
        }
    }
1042730
public function insertRows($table, array $settings, $bind = true)
    {
        //this is an array of arrays
        foreach ($settings as $index => $setting) {
            //Sqlite no available multi insert
            //there's work arounds, but no performance gain
            $this->insertRow($table, $setting, $bind);
        }
        
        return $this;
    }
1373563
public function table($table)
    {
        $processor = $this->getPostProcessor();

        $query = new MbDatabaseQueryBuilder($this, $this->getQueryGrammar(), $processor);

        return $query->from($table);
    }
1351345
public function insert(string $table = null, array $rowValues = null): Query\Insert
    {
        return new Query\Insert($table, $rowValues, $this->getConfigKey());
    }
1243417
public function upsert($table, $insertColumns, $updateColumns, &$params)
    {
        /**
 * @var Constraint[] $constraints 
*/
        list($uniqueNames, $insertNames, $updateNames) = $this->prepareUpsertColumns($table, $insertColumns, $updateColumns, $constraints);
        if (empty($uniqueNames)) {
            return $this->insert($table, $insertColumns, $params);
        }

        list(, $placeholders, $values, $params) = $this->prepareInsertValues($table, $insertColumns, $params);
        $insertSql = 'INSERT OR IGNORE INTO ' . $this->db->quoteTableName($table)
            . (!empty($insertNames) ? ' (' . implode(', ', $insertNames) . ')' : '')
            . (!empty($placeholders) ? ' VALUES (' . implode(', ', $placeholders) . ')' : $values);
        if ($updateColumns === false) {
            return $insertSql;
        }

        $updateCondition = ['or'];
        $quotedTableName = $this->db->quoteTableName($table);
        foreach ($constraints as $constraint) {
            $constraintCondition = ['and'];
            foreach ($constraint->columnNames as $name) {
                $quotedName = $this->db->quoteColumnName($name);
                $constraintCondition[] = "$quotedTableName.$quotedName=(SELECT $quotedName FROM `EXCLUDED`)";
            }
            $updateCondition[] = $constraintCondition;
        }
        if ($updateColumns === true) {
            $updateColumns = [];
            foreach ($updateNames as $name) {
                $quotedName = $this->db->quoteColumnName($name);
                if (strrpos($quotedName, '.') === false) {
                    $quotedName = "(SELECT $quotedName FROM `EXCLUDED`)";
                }
                $updateColumns[$name] = new Expression($quotedName);
            }
        }
        $updateSql = 'WITH "EXCLUDED" (' . implode(', ', $insertNames)
            . ') AS (' . (!empty($placeholders) ? 'VALUES (' . implode(', ', $placeholders) . ')' : ltrim($values, ' ')) . ') '
            . $this->update($table, $updateColumns, $updateCondition, $params);
        return "$updateSql; $insertSql;";
    }
206304
public function insert($table, $row)
	{
		$keys = implode('`, `', array_keys($row));
        $holds = implode(',', array_fill(0, count($row), '?'));
		$vals = array_values($row);

		$sql = "INSERT INTO `{$table}` (`{$keys}`) VALUES({$holds})";

        $stmt = $this->prepare($sql);
        return $stmt ? $stmt->execute($vals) : false;
	}
571054
public function prepareInsert($table, array $values) {

        // Initialize the query.
        $query = [];

        $query[] = "INSERT INTO ";
        $query[] = $table;
        $query[] = " (`";
        $query[] = implode("`, `", array_keys($values));
        $query[] = "`) VALUES (";
        $query[] = implode(", ", array_values($values));
        $query[] = ")";

        // Return the query.
        return implode("", $query);
    }
579848
public function insert($table, $data, $statements)
    {
        $input = [
            'columns' => '',
            'values' => ''
        ];

        $query = 'INSERT INTO `' . $table . '` ';

        foreach ($data as $column => $value) {
            $input['columns'] .= $column . ', ';

            $value = (is_null($statements) && is_string($value)) ? "'$value'" : $value;

            $input['values'] .= $value . ', ';
        }

        $query .= '(' . rtrim(trim($input['columns']), ',') . ') ';

        $query .= 'VALUES (' . rtrim(trim($input['values']), ',') . ')';

        return $this->query($query, 'INSERT');
    }
96243
public function update(string $table): Query\Update
    {
        $query = new Query\Update();
        $query->update($table);
        return $query;
    }
1247797
public function EmptyTable($Table = '') {
      if ($Table == '') {
         if (!isset($this->_Froms[0]))
            return FALSE;

         $Table = $this->_Froms[0];
      } else {
         $Table = $this->EscapeIdentifier($this->Database->DatabasePrefix.$Table);
      }


      $Sql = $this->GetDelete($Table);
      
      return $this->Query($Sql, 'delete');
   }
970558
public function insert($table = null)
    {
        $this->type = self::TYPE_INSERT;
        if ($table) {
            $this->table($table);
        }

        return $this;
    }
1234229
public static function insert( $table, $values = array(), $handler = null )
	{
		return Query_Insert::create( $table, $handler )->values( $values );
	}