lib/SqlServer.php
public function query(string $sql, array $params = []): Statement
    {
        if (!$stmt = sqlsrv_query($this->connection, $sql, $params)) {
            throw new SqlException('Query failed', sqlsrv_errors(), $sql, $params);
        }

        $statement = new Statement($stmt, false, $sql, $params);
        $statement->execute();
        return $statement;
    }
public function query(string $sql, array $params = []): Statement
    {
        if (!$stmt = sqlsrv_query($this->connection, $sql, $params)) {
            throw new SqlException('Query failed', sqlsrv_errors(), $sql, $params);
        }

        $statement = new Statement($stmt, false, $sql, $params);
        $statement->execute();
        return $statement;
    }
public function query ( string $ sql , array $ params = [ ] ) : Statement { if ( ! $ stmt = sqlsrv_query ( $ this -> connection , $ sql , $ params ) ) { throw new SqlException ( 'Query failed' , sqlsrv_errors ( ) , $ sql , $ params ) ; } $ statement = new Statement ( $ stmt , false , $ sql , $ params ) ; $ statement -> execute ( ) ; return $ statement ; }
Prepares and executes a single SQL Server query with bound parameters
@throws SqlException if an error occurs
Prepares and executes a single SQL Server query with bound parameters