public static function prepareInsertIgnore(string $table, array $values): array
    {
        $cols = [];
        $params = [];
        $marks = [];

        foreach ($values as $k => $v) {
            $cols[] = $k;
            $params[] = $v;
            $marks[] = '?';
        }

        $cols = static::escapeSqlWords($cols);

        $sql = 'INSERT IGNORE INTO ' . static::escapeSqlWords($table) . ' (';
        $sql .= implode(', ', $cols);
        $sql .= ') VALUES (';
        $sql .= implode(', ', $marks);
        $sql .= ')';

        return [
            'sql' => $sql,
            'params' => $params,
        ];
    }
public static function prepareInsertIgnore(string $table, array $values): array
    {
        $cols = [];
        $params = [];
        $marks = [];

        foreach ($values as $k => $v) {
            $cols[] = $k;
            $params[] = $v;
            $marks[] = '?';
        }

        $cols = static::escapeSqlWords($cols);

        $sql = 'INSERT IGNORE INTO ' . static::escapeSqlWords($table) . ' (';
        $sql .= implode(', ', $cols);
        $sql .= ') VALUES (';
        $sql .= implode(', ', $marks);
        $sql .= ')';

        return [
            'sql' => $sql,
            'params' => $params,
        ];
    }
public static function prepareInsertIgnore ( string $ table , array $ values ) : array { $ cols = [ ] ; $ params = [ ] ; $ marks = [ ] ; foreach ( $ values as $ k => $ v ) { $ cols [ ] = $ k ; $ params [ ] = $ v ; $ marks [ ] = '?' ; } $ cols = static :: escapeSqlWords ( $ cols ) ; $ sql = 'INSERT IGNORE INTO ' . static :: escapeSqlWords ( $ table ) . ' (' ; $ sql .= implode ( ', ' , $ cols ) ; $ sql .= ') VALUES (' ; $ sql .= implode ( ', ' , $ marks ) ; $ sql .= ')' ; return [ 'sql' => $ sql , 'params' => $ params , ] ; }
prepares "INSERT IGNORE" sql statement by array of parameters

@param string $table  table name
@param array  $values values for columns

@return array [sql, params] prepared SQL and params
prepares INSERT IGNORE sql statement by array of parameters