php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #66221 Change mssql_get_last_message() to support multiple
Submitted: 2013-12-02 19:02 UTC Modified: 2016-10-15 23:17 UTC
Votes:4
Avg. Score:4.8 ± 0.4
Reproduced:4 of 4 (100.0%)
Same Version:4 (100.0%)
Same OS:4 (100.0%)
From: scott at arciszewski dot me Assigned:
Status: Wont fix Package: MSSQL related
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: scott at arciszewski dot me
New email:
PHP Version: OS:

 

 [2013-12-02 19:02 UTC] scott at arciszewski dot me
Description:
------------
Currently, you can use mssql_get_last_message() to get the last error message reported by MSSQL. However, if an INSERT fails, PHP only returns "The statement has been terminated" and truncates the reason why it failed. (Which is annoying if your DBA added columns that cannot accept NULL values.)

Test script:
---------------
I'd like to propose the addition of an error message queue that can be iterated for better debugging.

For example:

$sql = mssql_query($query);
foreach(mssql_get_messages() as $error) {
  var_dump($error);
}

Expected result:
----------------
An array of error messages; optionally with timestamps


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-10-15 23:17 UTC] kalle@php.net
-Status: Open +Status: Wont fix
 [2016-10-15 23:17 UTC] kalle@php.net
With MSSQL being removed from PHP as of PHP7.0, and ext/mssql not having a maintainer, I'm gonna close this report as a Won't fix, until maybe one day it will find a new maintainer.

Alternatively you can use sqlsrv from Microsoft if you are on Windows, or pdo_dblib if you are on Unix.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 11:01:27 2024 UTC