mssql_free_statement
mssql_guid_string
Mssql Functions
PHP Manual

# mssql_get_last_message

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

mssql_get_last_message — Returns the last message from the server

### Descripción

string mssql_get_last_message ( void )

Gets the last message from the MS-SQL server

### Lista de parámetros

This function has no parameters.

### Valores retornados

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

### Ejemplos

Example #1 mssql_get_last_message() example

`<?php
// Connect to MSSQL
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());
}
?>`

El resultado del ejemplo seria algo similar a:

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

### Ver también

- mssql_min_error_severity() - Sets the minimum error severity
- mssql_min_message_severity() - Sets the minimum message severity

mssql_free_statement
mssql_guid_string
Mssql Functions
PHP Manual