Query: mssql_get_last_message
OS: php
Section: 3
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
MSSQL_GET_LAST_MESSAGE(3) MSSQL_GET_LAST_MESSAGE(3) mssql_get_last_message - Returns the last message from the serverSYNOPSISstring mssql_get_last_message (void )DESCRIPTIONGets the last message from the MS-SQL serverPARAMETERSThis function has no parameters.RETURN VALUESReturns last error message from server, or an empty string if no error messages are returned from MSSQL.EXAMPLESExample #1 mssql_get_last_message(3) example <?php // Connect to MSSQL and select the database mssql_connect('KALLESPCSQLEXPRESS', 'sa', 'phpfi'); mssql_select_db('php'); // Make a query that will fail $query = @mssql_query('SELECT * FROM [php].[dbo].[not-found]'); if (!$query) { // The query has failed, print a nice error message // using mssql_get_last_message() die('MSSQL error: ' . mssql_get_last_message()); } ?> The above example will output something similar to: MSSQL error: Invalid object name 'php.dbo.not-found'.SEE ALSOmssql_min_error_severity(3), mssql_min_message_severity(3). PHP Documentation Group MSSQL_GET_LAST_MESSAGE(3)