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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
6 + 36 = ?
Subscribe to this entry?

 
 [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: Sat Apr 27 23:01:30 2024 UTC