public static function insert($table, array $set)
    {
        $sql = $values = $fields = $holders = [];
        $sql[] = 'INSERT INTO ' . static::e($table);

        foreach($set as $field => $value) {
            $fields[] = static::e($field);
            $holders[] = '?';
            $values[] = $value;
        }

        $sql[] = '(' . implode(', ', $fields) . ')';
        $sql[] = 'VALUES (' . implode(', ', $holders) . ')';

        $sql = implode("\n", $sql);
        return [$sql, $values];
    }
public static function insert($table, array $set)
    {
        $sql = $values = $fields = $holders = [];
        $sql[] = 'INSERT INTO ' . static::e($table);

        foreach($set as $field => $value) {
            $fields[] = static::e($field);
            $holders[] = '?';
            $values[] = $value;
        }

        $sql[] = '(' . implode(', ', $fields) . ')';
        $sql[] = 'VALUES (' . implode(', ', $holders) . ')';

        $sql = implode("\n", $sql);
        return [$sql, $values];
    }
public static function insert ( $ table , array $ set ) { $ sql = $ values = $ fields = $ holders = [ ] ; $ sql [ ] = 'INSERT INTO ' . static :: e ( $ table ) ; foreach ( $ set as $ field => $ value ) { $ fields [ ] = static :: e ( $ field ) ; $ holders [ ] = '?' ; $ values [ ] = $ value ; } $ sql [ ] = '(' . implode ( ', ' , $ fields ) . ')' ; $ sql [ ] = 'VALUES (' . implode ( ', ' , $ holders ) . ')' ; $ sql = implode ( "\n" , $ sql ) ; return [ $ sql , $ values ] ; }
Compile INSERT INTO

@param string $table
@param array $set
@return array
Compile INSERT INTO