Problems mssql_get_last_message()
| From: | Michael Bretterklieber | Date: | Fri, 12 Jul 2002 08:15:53 +0000 |
| Subject: | Problems mssql_get_last_message() | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-20503@lists.php.net to get a copy of this message | ||
Hi,
I have problems with mssql_get_last_message(). This function doesen't return the whole error message, it only returns "Die Anweisung wurde beendet" and not the specific error message. Now I use something like this to workaround the problem:
... snip ...
$this->errno = mssql_result(@$this->priv_query('SELECT @@ERROR as errorcode', $this->dbc), 0 , 'errorcode');
$this->error = mssql_result($this->priv_query("SELECT description FROM master.dbo.sysmessages WHERE error=$this->errno and msglangid = 1031", $this->dbc), 0, 'description');
$this->error = str_replace ('%', '%%', $this->error);
but the problem is, that I get the error message with placeholders (not parsed):
Die %1!-Anweisung verstieß gegen die %2! %3!-Einschränkung '%4!'. Der Konflikt trat in der %6!-Datenbank, Tabelle '%8!'%10!%11!%13! auf.)
are there any hints to get mssql_get_last_message() to work?
bye,
--
--------------------------------------
Michael Bretterklieber
LCP
JAWA Management Software GmbH
Liebenauer Hauptstr. 200
A-8041 GRAZ
Tel: ++43-(0)316-403274-12
Fax: ++43-(0)316-403274-10
GSM: ++43-(0)676-93 96 698
Michael.Bretterklieber@jawa.at
homepage: http://www.jawa.at
--------- privat -----------
E-mail: mbretter@inode.at
homepage: http://www.inode.at/mbretter
--------------------------------------
"...the number of UNIX installations has grown to 10, with more expected..."
- Dennis Ritchie and Ken Thompson, June 1972