cvs: php4 /pear/DB odbc.php
| From: | Chuck Hagenbuch | Date: | Tue, 06 Nov 2001 14:42:10 +0000 |
| Subject: | cvs: php4 /pear/DB odbc.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-1269@lists.php.net to get a copy of this message | ||
chagenbu Tue Nov 6 09:42:10 2001 EDT
Modified files:
/php4/pear/DB odbc.php
Log:
this code _does_ work on versions of php without version_compare.
also, silence an odbc_exec() call with an @ - we check for errors already.
Index: php4/pear/DB/odbc.php
diff -u php4/pear/DB/odbc.php:1.45 php4/pear/DB/odbc.php:1.46
--- php4/pear/DB/odbc.php:1.45 Thu Nov 1 19:45:41 2001
+++ php4/pear/DB/odbc.php Tue Nov 6 09:42:10 2001
@@ -17,7 +17,7 @@
// | |
// +----------------------------------------------------------------------+
//
-// $Id: odbc.php,v 1.45 2001/11/02 00:45:41 cox Exp $
+// $Id: odbc.php,v 1.46 2001/11/06 14:42:10 chagenbu Exp $
//
// Database independent query interface definition for PHP's ODBC
// extension.
@@ -160,7 +160,7 @@
{
$this->last_query = $query;
$query = $this->modifyQuery($query);
- $result = odbc_exec($this->connection, $query);
+ $result = @odbc_exec($this->connection, $query);
if (!$result) {
return $this->odbcRaiseError(); // XXX ERRORMSG
}
@@ -211,13 +211,13 @@
function fetchInto($result, &$row, $fetchmode, $rownum=null)
{
if ($rownum !== null) {
- if (version_compare(phpversion(), "4.0.5", "lt")) {
+ if (!function_exists('version_compare') || version_compare(phpversion(),
"4.0.5", "lt")) {
$cols = odbc_fetch_into($result, $rownum, &$row);
} else {
$cols = odbc_fetch_into($result, $rownum, $row);
}
} else {
- if (version_compare(phpversion(), "4.0.5", "lt")) {
+ if (!function_exists('version_compare') || version_compare(phpversion(),
"4.0.5", "lt")) {
$cols = odbc_fetch_into($result, &$row);
} else {
$cols = odbc_fetch_into($result, $row);
@@ -441,4 +441,4 @@
// tab-width: 4
// c-basic-offset: 4
// End:
-?>
\ No newline at end of file
+?>