note 54680 added to function.mssql-get-last-message
| From: | jessicax at mymelody dot com | Date: | Tue, 12 Jul 2005 15:44:34 +0000 |
| Subject: | note 54680 added to function.mssql-get-last-message | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-91821@lists.php.net to get a copy of this message | ||
I've noticed that there's a few people putting really elongated code out there for a MSSQL
Connection / Error function.
Firstly, i think that rewriting pre-existing functions is a waste of parsing time, so if you're
going to try and return an error, usee mssql_get_last_message() as you would with mysql_error().
Here is an adapted version of a MySQL Connection function;
function mssql_autoconnect() {
$cString = parse_url($config['connect_url']);
$cLink = mssql_connect($cString['host'], $cString['user'],
$cString['pass']) or die(mssql_get_last_message());
mssql_select_db(preg_replace("///",$cString['path']),$cLink);
return $cLink;
}
----
Manual Page -- http://www.php.net/manual/en/function.mssql-get-last-message.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+54680
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+54680&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+54680&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+54680&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+54680&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+54680&report=yes&reason=non-english
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+54680&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+54680&report=yes
Search -- http://master.php.net/manage/user-notes.php