Good day. Prompt the function to display an error (similar to mysql_error) using PHP tools when working with SQL Server or an alternative way to find out the error. PS If the connection to the database is unsuccessful, no error pops up. I connect the mssql_connect function ("host", "login", "pass")

    1 answer 1

    mssql_get_last_message()

    If no error messages are returned from MSSQL.

    UPD. Unfortunately, there is no server at hand to check, but maybe it generates 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 ODBC driver.

    And also pay attention to the functions in "See Also" in the description of mssql_get_last_message ()

    • The function used: mssql_connect (...) or die (mssql_get_last_message ()). I get an empty string on error - there is an error, but this function does not return it. - Afipsky
    • Thank. Error logging was not enabled on my hosting, turned on, errors are displayed. I also tried to work with the help of the ODBC driver, but the connection with it on the Denver is long processed. Thanks again, a good resource - forum users respond quickly, the admin is involved in resolving the issue and ultimately helping to solve the problem. - Afipsky