cvs: /php4/pear/DB mssql.php
| From: | Sterling Hughes | Date: | Tue, 07 Mar 2000 20:18:43 +0000 |
| Subject: | cvs: /php4/pear/DB mssql.php | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-11708@lists.php.net to get a copy of this message | ||
sterling Tue Mar 7 12:18:43 2000 EDT
Modified files:
/php4/pear/DB mssql.php
Log:
Prepended an @ sign to the mssql_* function calls, that way they don't wine and moan
when something goes wrong, allowing for custom error messages.
Index: php4/pear/DB/mssql.php
diff -u php4/pear/DB/mssql.php:1.2 php4/pear/DB/mssql.php:1.3
--- php4/pear/DB/mssql.php:1.2 Tue Mar 7 09:51:23 2000
+++ php4/pear/DB/mssql.php Tue Mar 7 12:18:13 2000
@@ -17,7 +17,7 @@
// | |
// +----------------------------------------------------------------------+
//
-// $Id: mssql.php,v 1.2 2000/03/07 17:51:23 sterling Exp $
+// $Id: mssql.php,v 1.3 2000/03/07 20:18:13 sterling Exp $
//
// Database independent query interface definition for PHP's Microsoft SQL Server
// extension.
@@ -68,7 +68,7 @@
$conn = $connect_function($dbhost);
}
if ($dsninfo['database']) {
- mssql_select_db($dsninfo['database'], $conn);
+ @mssql_select_db($dsninfo['database'], $conn);
} else {
return DB_ERROR;
}
@@ -77,11 +77,11 @@
}
function disconnect() {
- return mssql_close($this->connection);
+ return @mssql_close($this->connection);
}
function &query( $stmt ) {
- $result = mssql_query($stmt, $this->connection);
+ $result = @mssql_query($stmt, $this->connection);
if (!$result) {
return DB_ERROR;
}
@@ -96,7 +96,7 @@
}
function simpleQuery($stmt) {
- $result = mssql_query($stmt, $this->connection);
+ $result = @mssql_query($stmt, $this->connection);
if (!$result) {
return DB_ERROR;
}
@@ -111,9 +111,9 @@
function &fetchRow($result, $getmode=DB_GETMODE_DEFAULT) {
if ($getmode & DB_GETMODE_ASSOC) {
- $row = mssql_fetch_array($result);
+ $row = @mssql_fetch_array($result);
} else {
- $row = mssql_fetch_row($result);
+ $row = @mssql_fetch_row($result);
}
if (!$row) {
return DB_ERROR;
@@ -123,9 +123,9 @@
function fetchInto($result, &$ar, $getmode=DB_GETMODE_DEFAULT) {
if ($getmode & DB_GETMODE_ASSOC) {
- $ar = mssql_fetch_array($result);
+ $ar = @mssql_fetch_array($result);
} else {
- $ar = mssql_fetch_row($result);
+ $ar = @mssql_fetch_row($result);
}
if (!$ar) {
return DB_ERROR;
@@ -135,7 +135,7 @@
function freeResult($result) {
if (is_resource($result)) {
- return mssql_free_result($result);
+ return @mssql_free_result($result);
}
if (!isset($this->prepare_tokens[$result])) {
return false;
@@ -146,7 +146,7 @@
}
function numCols($result) {
- $cols = mssql_num_fields($result);
+ $cols = @mssql_num_fields($result);
if (!$cols) {
return DB_ERROR;
}
@@ -176,7 +176,7 @@
function execute($stmt, $data = false) {
$realquery = $this->execute_emulate_query($stmt, $data);
- $result = mssql_query($realquery, $this->connection);
+ $result = @mssql_query($realquery, $this->connection);
if (!$result) {
return DB_ERROR;
}