PHP+SQL Server: How to display an error?

Good afternoon.
Suggest a function to display an error (analogue of mysql_error) using PHP tools when working with SQL Server or an alternative way to find out the error.
P.S. If the connection to the database fails, no error pops up. I connect with the mssql_connect(“host”,”login”,”pass”)


Answer 1, authority 100%

mssql_get_last_message()

Returns last error message from server, or an empty string if no error messages are returned from MSSQL.

UPD.Unfortunately, I don’t have a server handy to check, but it might generate standard PHP errors. Make sure you have error logging enabled:

error_reporting(-1);
ini_set('display_errors', 'On');

Or, if your code is not tied to the mssql extension, you can use the ODBCdriver.

Also note the functions in “See Also” in the description of mssql_get_last_message()