Skip to content
Advertisement

PHP/MSSQL: query result to table

I’m trying to return results from a MS SQL query, into a table. But somehow I only get a blanc page with the headers. I don’t know what i’m doing wrong or where to search for an answer. Could someone please direct me in the right way.

Help is appreciated

JavaScript

Advertisement

Answer

What I think is that $dbh->query($sql) is the reason for your error. Variable $dbh holds the result from sqlsrv_connect(), but you use it as a PDO class variable.

Change your code like this (including error checks):

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement