Perform a INSERT statement

@param string $table
@param array $data

@return int last inserted id
351649
public function insert($table, array $data)
    {
        $nameFields = join(',', array_keys($data));
        $preparedValues = $this->prepareValues($data);
        $keyValues = join(",", array_keys($preparedValues));
        $queryString = "INSERT INTO {$table} ({$nameFields}) VALUES ({$keyValues});";

        $this->query($queryString, $preparedValues);

        return $this->getInsertId();
    }
1361683
public function prepareInsert($table, array $data)
    {
        $data += $this->getDefaultValues($table);
        return $this->filterValues($table, $data);
    }
460206
public function insert(string $table, array $values): int {
		
		// this is where we start to deviate from simply changing the names of
		// the Aura\Sql functions to match existing function calls within my other
		// applications.  we have two options here:  inserting a single row or
		// multiple ones.  either way the $values array tells us what to do.  if
		// it's an array of arrays, then we do multiples.
		
		try {
			$inserted = isset($values[0]) && is_array($values[0])
				? $this->insertMultiple($table, $values)
				: $this->insertSingle($table, $values);

			return !is_numeric($inserted) ? sizeof($inserted) : $inserted;
		} catch (\PDOException $pdoException) {
			throw $this->prepareDatabaseException($pdoException, $table, $values);
		}
	}
309596
public function insert($table, $data)
    {
        $query = $this->provider->buildInsertQuery($table, $data);

        return $this->provider->query($query, null);
    }
102419
public function insert(string $table): Query\Insert
    {
        $query = new Query\Insert();
        $query->insert($table);
        return $query;
    }
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);
	}
513882
public function insert($table, array $data)
     {
         try {
             krsort($data);

             $fieldNme = implode('`,`', array_keys($data));
             $fieldValues = ':'.implode(',:', array_keys($data));
             $this->_beginTransaction();

             $stmt = $this->conn->prepare("INSERT INTO $table (`$fieldNme`) VALUES ($fieldValues)");

             foreach ($data as $key => $values) {
                 $stmt->bindValue(":$key", $values);
             }
             $this->_commit();
             $stmt->execute();
             unset($stmt);
         } catch (Exception $e) {
             $this->_Rollback();
             echo 'error insert '.$e->getMessage();
         }
     }
639825
final public function insertGetId(array $datas) {
      $this->connection();
      $this->last_id = NULL;
      if ( $this->driver=='pgsql' ) {
         $this->insert( $datas, TRUE );
         if ( @$this->data[0] ) {
            $this->last_id = @$this->data[0]->{$this->primaryKey};
         }
      }
      else {
         $this->insert( $datas );
         $this->last_id = $this->id_conn->lastInsertId();
      }
      return (int) $this->last_id;
   }
378819
public function insert( $query, array $data = [ ] )
    {
        $id = NULL;

        $statement = $this->database->prepare( $query );

        if ( FALSE === $statement )
        {
            $this->close();

            throw new DatabaseException( 'Failed to create prepared statement.' );
        }

        $result = $statement->execute( $data );

        $this->query = $statement->queryString;

        if ( FALSE !== $result )
        {
            $result = ( int ) $this->database->lastInsertId();
        }

        return $result;
    }
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;
    }
206326
public function insert($table, $info)
    {
        $fields = $this->filter($table, $info);
        $sql = "INSERT INTO " . $table . " (" . implode($fields, ", ") . ") VALUES (:" . implode($fields, ", :") . ");";
        $bind = array();
        foreach ($fields as $field)
            $bind[":$field"] = $info[$field];
        return $this->run($sql, $bind);
    }
588479
public function insert($table, array $columns)
    {
        if (empty($columns)) {
            return 0;
        }
        return $this->getInsertBuilder()
            ->setTable($table)
            ->setColumns($columns)
            ->execute();
    }
951395
public static function insert($table, $data = null) {
        if ($data !== null) {
            return Insert::insert($table, $data);
        } else {
            return Insert::table($table);
        }
    }
1158879
public function batchInsert($table, array $data, $extra = null)
    {
        $table = $this->getTable($table);
        $field = implode(', ', array_keys($data[0]));
        $placeholders = array();
        $values = array();

        switch ($this->driver) {
            default:
            case 'mysql':
            case 'pgsql':
                foreach ($data as $row) {
                    $placeholders[] = '(' . implode(', ', array_pad(array(), count($row), '?')) . ')';
                    $values = array_merge($values, array_values($row));
                }
                $placeholder = 'VALUES ' . implode(', ', $placeholders);
                break;

            // For SQLite before 3.7.11, http://www.sqlite.org/releaselog/3_7_11.html
            case 'sqlite':
                foreach ($data as $row) {
                    $placeholders[] = 'SELECT ' . implode(', ', array_pad(array(), count($row), '?'));
                    $values = array_merge($values, array_values($row));
                }
                $placeholder = implode(' UNION ', $placeholders);
                break;
        }

        $query = "INSERT INTO $table ($field) $placeholder";
        $extra && $query .= ' ' . $extra;

        return $this->executeUpdate($query, $values);
    }
970961
public static function replace($table, $data)
    {
        $db = self::Using(self::$using_dbo_id);
        return $db->replace($table, $data);
    }
115882
public function set($table, $data, $tablePrefix = null)
    {
        is_null($tablePrefix) && $tablePrefix = $this->tablePrefix;
        $tableName = $tablePrefix . $table;
        if (is_array($data)) {
            $s = $this->arrToCondition($data);
            $this->currentQueryIsMaster = true;
            $stmt = $this->prepare("INSERT INTO {$tableName} SET {$s}", $this->wlink);
            $this->execute($stmt);

            $this->setCacheVer($tableName);
            return $this->insertId();
        } else {
            return false;
        }
    }
528559
public function update($table, array $data)
    {
        $this->queryBuilder->update($table, $this->asData($data));
        return $this;
    }