My problem in particular is that I must generate an excel [.xlsx] (use PHPExcel) with data from SQL Server with PHP.
The script that I edited already existed with MySQL statements and it worked perfectly, but when I change the sentences by SQL it generates the following error:
"Fatal error: Call to a member function query () on a non-object in C: \ ..."
And the code in summary is:
$query_Data="select * from etc etc etc";
$connectionInfo1 = array( "Database"=>xxx, "UID"=>yyy, "PWD"=>zzz);
$conexion = sqlsrv_connect($serverName, $connectionInfo1);
$resultado = $conexion->query($query_Data); [el error que funcionaba con mysql]
(cualquier sentencia que reemplace a query() me genera error)
Note: I do not know if I have to see that the method of connection call is different in MySQL (that if it works) to SQL (which does not work.)
I appreciate you can help me with information on how I can solve this "fatal error", thank you in advance!