mssql_get_last_message

(PHP 4, PHP 5, PECL odbtp >= 1.1.1)

mssql_get_last_messageReturns the last message from the server

Warning

This function was REMOVED in PHP 7.0.0.

Alternatives to this function include:

说明

mssql_get_last_message ( void ) : string

Gets the last message from the MS-SQL server

参数

此函数没有参数。

返回值

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

范例

Example #1 mssql_get_last_message() example

<?php
// Connect to MSSQL and select the database
mssql_connect('KALLESPC\SQLEXPRESS''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());
}
?>

以上例程的输出类似于:

MSSQL error: Invalid object name 'php.dbo.not-found'.

参见

相关文章
php crack 函数 returns the message from the last obscure checkphp ibm db2 函数 returns the last connection error message and sqlcode valuephp ibm db2 函数 returns a string containing the last sql statement error messagephp frontbase 函数 returns the error message from previous operationphp grapheme 函数 returns part of haystack string from the first occurrence of case insensitive needle to the end of haystackphp informix 函数 returns error message of last informix callphp json 函数 returns the error string of the last json encode or json decode callphp mailparse 函数 returns an array of mime section names in the supplied messagephp maxdb 函数 returns the error code from last connect callphp maxdb 函数 returns the number of warnings from the last query for the given linkphp semaphore 函数 returns information from the message queue data structurephp msql 函数 returns error message of last msql callphp mssql 函数 returns the last message from the serverphp mysqlnd ms 函数 returns an array which describes the last used connectionphp oci8 函数 returns the next child statement resource from a parent statement resource that has oracle database 12c implicit result setsphp session pgsql 函数 returns number of errors and last error messagephp sybase 函数 returns the last message from the serverphp win32service 函数 returns the last control message that was sent to this servicephp yaz 函数 returns number of hits for last searchphp hyperwave api 函数 returns statistics about database server
关注编程学问公众号