mssql_get_last_message Returns the last message from the server php函数


mssql_get_last_message

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

mssql_get_last_messageReturns the last message from the server

说明

string mssql_get_last_message ( void )

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('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());
}
?>

以上例程的输出类似于:

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

参见


« 
» 
快速导航

Copyright © 2016 phpStudy | 豫ICP备2021030365号-3