From:             klaus dot kuehne at gga-hannover dot de
Operating system: Windows XP Server
PHP version:      4.3.10
PHP Bug Type:     MSSQL related
Bug description:  Useless results from mssql_get_last_message()

Description:
------------
Hello,

in many cases, mssql_get_last_message() delivers useless results, which
are differing from the original SQL Server messages. An example:
..
$ret = mssql_query("insert into TAB (KEY) values (13)", $con);
if (!$ret) {
   $errtxt = mssql_get_last_message();
   die($errtxt);
}
..

if value 13 already exists in the unique indexed column KEY of TAB,
$errtxt will be set to "Die Anweisung wurde beendet" (in german,
translated to english like "statement aborted"). Instead of this, one
could expect the message "Cannot insert duplicate key row in object ...
with unique index ..." (Code = 2601).

This occurs in many other cases, too. In other cases (e. g. SQL-access
failed caused by missing user rights on the table),
mssql_get_last_message() delivers an empty string, even if the return code
of mssql_query() is FALSE. 

What ist the reason for mhis?

Regards

Klaus Kühne, GGA Institute Hannover, Germany


-- 
Edit bug report at http://bugs.php.net/?id=31428&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=31428&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=31428&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=31428&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=31428&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=31428&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=31428&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=31428&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=31428&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=31428&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=31428&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=31428&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=31428&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=31428&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=31428&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=31428&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=31428&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=31428&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=31428&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=31428&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=31428&r=mysqlcfg

Reply via email to