Insert a new row in the table
@param  array   $data   key value pairs, where each key is the column name and the value is the value to insert
@return array           the inserted ID where keys are column names and values are column values
8786
public function insert(array $data) : array
    {
        $table = $this->definition->getName();
        $columns = $this->definition->getFullColumns();
        $insert = [];
        foreach ($data as $column => $value) {
            if (isset($columns[$column])) {
                $insert[$column] = $this->normalizeValue($columns[$column], $value);
            }
        }
        if (!count($insert)) {
            throw new DBException('No valid columns to insert');
        }
        $sql = 'INSERT INTO '.$table.' ('.implode(', ', array_keys($insert)).') VALUES (??)';
        $par = [$insert];
        $primary = $this->definition->getPrimaryKey();
        if (!count($primary)) {
            $this->db->query($sql, $par);
            return [];
        }
        if ($this->db->driverName() === 'oracle') {
            $ret = [];
            foreach ($primary as $k) {
                $ret[$k] = str_repeat(' ', 255);
                $par[] = &$ret[$k];
            }
            $sql .= ' RETURNING ' . implode(',', $primary) . ' INTO ' . implode(',', array_fill(0, count($primary), '?'));
            $this->db->query($sql, $par);
            return $ret;
        } else {
            $ret = [];
            $ins = $this->db->query($sql, $par)->insertID();
            foreach ($primary as $k) {
                $ret[$k] = $data[$k] ?? $ins;
            }
            return $ret;
        }
    }
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);
	}
1160616
public function insert($data) {
        $map = $this->extractMap($data);
        $sql = "INSERT INTO $this->KVS_TABLE ($this->KVS_FK_NAME, $this->KVS_SK_NAME,
            uk1, sk1, tk1, co1, co2, json_body, created_at)
            VALUES (:foreign_key, :secondary_key, :uk1, :sk1, :tk1, :co1, :co2, :json_body, $this->NOW)";
        $map[':foreign_key'] = $this->KVS_FK;
        $map[':secondary_key'] = $this->KVS_SK;

        $copy = self::preStoreCleanup($data);
        $map[':json_body'] = json_encode($copy);
        $stmt = $this->PDOX->queryDie($sql, $map);

        if ( $stmt->success) return(intval($this->PDOX->lastInsertId()));
        return false;
    }
421888
public function put($data)
    {
        if (empty($data) or !is_array($data))
        {
            return false;
        }
        if ($this->db->insert($data, $this->table))
        {
            $lastInsertId = $this->db->lastInsertId();
            if ($lastInsertId == 0)
            {
                return true;
            }
            else
            {
                return $lastInsertId;
            }
        }
        else
        {
            return false;
        }
    }
1161241
public function insert(array $data)
    {
        if (false === $this->trigger('before_insert', $this)) {
            return false;
        }

        if($this->dateFormat && $this->updateTime && $this->createTime){
            $time = date('Y-m-d H:i:s', time());
            $data[$this->updateTime] = $time;
            $data[$this->createTime] = $time;
        } else {
            $time =  time();
            $data[$this->updateTime] =  $time;
            $data[$this->createTime] =  $time;
        }

        $response = $this->getQuery()->insert($data);

        if (false === $this->trigger('after_insert', $this)) {
            return false;
        }
        return $response;
    }
1301427
public function insert(array $data)
    {
        if (isset($data['id'])) {
            if (array_key_exists($data['id'], $this->table->data['data'])) {
                return null;
            }
        } else {
            $data = ['id' => $this->generateId()] + $data;
        }

        $this->table->data['data'][$data['id']] = $data;
        $this->table->save();

        return $data['id'];
    }
841966
public function addRow($data, $rowId = null)
    {
        if (($rowId === null) && isset($data['id'])) {
            $rowId = $data['id'];
        }

        if ($rowId === null) {
            $rowId = count($this->rows);
        }

        $this->rows[$rowId] = $data;

        return $this;
    }
1199415
public function replace(array $data) {
        $addFields = implode('`,`', array_keys($data));
        return $this->command()
            ->insertOrReplace("`{$addFields}`", Str::repeat('?', $data),
                array_values($data));
    }
433240
private function insertData($data)
    {
        $inserted = Yii::$app->db->createCommand()->batchInsert(
            $this->getName(),
            $this->cleanUpBatchInsertFields($this->getFields()),
            $this->cleanUpMatchRow($data)
        )->execute();

        return $inserted;
    }
575050
public function Insert($table, $data = array())
    {
        if (empty($table) || empty($data)) {
            return false;
        }

        //Before we set the columns, make sure we only use the column that re meant to be filled.
        foreach ($data as $key => $val) {
            if (empty($val)) {
                unset($data[$key]);
            }
        }

        //Get all the columns that are being set
        $columns = array_keys($data);

        //If the columns are not empty, proceed with the save
        if (!empty($columns)) {
            //Create a newInsert object
            $insert = $this->queryFactory->newInsert();

            //Set the table
            $insert->into($table);

            //Set the columns
            $insert->cols($columns);

            //Bind the values to be saved
            $insert->bindValues($data);

            //return the insert id
            return $this->exec($insert->getStatement(), $insert->getBindValues());

        }

        return false;
    }
419996
public function buildInsertSQL($table = null, $data = array())
	{
		$data = $this->parseParams($data);
		if(isAssocArray($data))
		{
			$keys = array_keys($data);
			$valuesKeys = $keys;
			foreach($valuesKeys as $i => $v)
			{
				$valuesKeys[$i] = $this->parseParamName($valuesKeys[$i]);
			}
			return 'insert into ' . $this->parseTable($table) . '(' . implode(',',array_map(array($this,'parseKeyword'),$keys)) . ') values(:' . implode(',:',$valuesKeys) . ')' . $this->parseLock();
		}
		else
		{
			return 'insert into ' . $this->parseTable($table) . ' values(' . substr(str_repeat('?,',count($data)),0,-1) . ')' . $this->parseLock();
		}
	}
1269767
public function create($table, $data){
        $keys = array_keys($data);
        $values = ':' . implode(',:', $keys);
        $keys = implode(',', $keys);
        return $this->query($this->set("INSERT INTO {$table} ({$keys}) VALUES({$values})", $data));
    }
1202213
public function insert(array $data) {
		$data = $this->filterFields($data, $this->_allowed_insert_fields);
		$data['created_at'] = Factory::load('\datetime')->format('Y-m-d H:i:s');

		return $this->_db->insertSafe($this->_table, $data);
	}
309596
public function insert($table, $data)
    {
        $query = $this->provider->buildInsertQuery($table, $data);

        return $this->provider->query($query, null);
    }
906414
public function insert($table, array $data)
    {
        // Prepare
        $columnPart = "";
        $valuePart = "";

        // Loop the data
        foreach ($data as $column => $value) {
            $columnPart .= "`$column`, ";
            $valuePart .= "?, ";
        }

        // Remove last commas
        $columnPart = substr($columnPart, 0, -2);
        $valuePart = substr($valuePart, 0, -2);

        $query = "INSERT INTO `$table` ($columnPart) VALUES ($valuePart)";


        // Prepare and bind
        $statement = $this->prepare($query);

        $idx = 0;
        foreach ($data as $key => $value) {
            $statement->bindValue(($idx+1), $value, Database::typeOfValue($value));
            $idx++;
        }

        // Execute and return the execute returning value.
        return $statement->execute();
    }
1004090
public function insertUpdate(array $data)
    {
        $affected = $this->update($data);
        return $affected ?: $this->insert($data);
    }
524755
public function add(array $data)
    {
        if (!$this->isDb()) {
            return false;
        }

        $data += array(
            'created' => GC_TIME,
            'log_id' => gplcart_string_random(6)
        );

        try {
            $result = (bool) $this->db->insert('log', $data);
        } catch (Exception $ex) {
            $result = false;
        }

        return $result;
    }