php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #46472 Broken example in function mssql_get_last_message
Submitted: 2008-11-03 15:03 UTC Modified: 2008-11-03 16:08 UTC
From: n dot richthof at itcampus dot eu Assigned:
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS: Irrelevant
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: n dot richthof at itcampus dot eu
New email:
PHP Version: OS:

 

 [2008-11-03 15:03 UTC] n dot richthof at itcampus dot eu
Description:
------------
The example reads:

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

The line
    die('MSSQL error: ' . mssql_get_last_error());
should be
    die('MSSQL error: ' . mssql_get_last_message());


Reproduce code:
---------------
Check http://www.php.net/manual/en/function.mssql-get-last-message.php


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-11-03 16:08 UTC] rquadling@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.


 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Thu Oct 08 03:00:02 2026 UTC