none
Query doesn't show same results as in smss RRS feed

  • Question

  • Hello,

    i've got the following environment: ubuntu18.04, apache 2.4, php 7.3, and the "PHP drivers Version 5.6.0 for SQL Server"

    my sql query (it contains CTE's and union function) returns 1573 values.
    The same query via my php script returns me 11 values ????

    any ideas why?

    this is my php mssql class

    $serverName = 'tcp:'.$this::sql_server.','.$this::sql_port;
    $connectionOptions = array(
    	"Uid"					=> $this::sql_user,
    	"PWD"					=> $this::sql_pw,
    	"ReturnDatesAsStrings"	=> true,
    	"Encrypt"				=> true,
    	"TrustServerCertificate"=> true,
    	"LoginTimeout"			=> 15			
    	);
    	
    $this->verbindung = sqlsrv_connect($serverName, $connectionOptions);
    
    
    
    $query = sqlsrv_query($this->verbindung, $SQL);
    $array = array();
    while($row = sqlsrv_fetch_array($query, SQLSRV_FETCH_ASSOC)){
    	$array[] = $row;
    }
    sqlsrv_free_stmt($query);

    Regards

    Tobias

    supplementing 1: I've created a view with the same code but i'm getting the same few resulsts

     supplementing 2: After some more testings, i think there are some issues with the sqlsrv driver from microsoft.
    The same Query with pdo_sqlsrv is working and with sqlsrv not.

    pdo_sqlsrv => all 1573 results
    sqlsrv => 5

    can someone confirm the problem?

    • Edited by TobiasMa Sunday, March 17, 2019 11:26 PM
    Sunday, March 17, 2019 3:14 PM

All replies

  • use profiler to troubleshoot.

    https://social.technet.microsoft.com/wiki/contents/articles/37872.sql-server-installation-on-centos-linux.aspx

    Saturday, March 23, 2019 4:56 AM