summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/adodb-mysqli.inc.php8
-rw-r--r--drivers/adodb-postgres7.inc.php4
2 files changed, 7 insertions, 5 deletions
diff --git a/drivers/adodb-mysqli.inc.php b/drivers/adodb-mysqli.inc.php
index c2415163..9c98fb9a 100644
--- a/drivers/adodb-mysqli.inc.php
+++ b/drivers/adodb-mysqli.inc.php
@@ -1175,13 +1175,13 @@ class ADODB_mysqli extends ADOConnection {
function getCharSet()
{
- //we will use ADO's builtin property charSet
- if (!method_exists($this->_connectionID,'character_set_name'))
+ if (!$this->_connectionID || !method_exists($this->_connectionID,'character_set_name')) {
return false;
+ }
$this->charSet = @$this->_connectionID->character_set_name();
if (!$this->charSet) {
- return false;
+
} else {
return $this->charSet;
}
@@ -1189,7 +1189,7 @@ class ADODB_mysqli extends ADOConnection {
function setCharSet($charset)
{
- if (!method_exists($this->_connectionID,'set_charset')) {
+ if (!$this->_connectionID || !method_exists($this->_connectionID,'set_charset')) {
return false;
}
diff --git a/drivers/adodb-postgres7.inc.php b/drivers/adodb-postgres7.inc.php
index 2cfe694d..38762bf3 100644
--- a/drivers/adodb-postgres7.inc.php
+++ b/drivers/adodb-postgres7.inc.php
@@ -280,7 +280,9 @@ class ADODB_postgres7 extends ADODB_postgres64 {
*/
function getCharSet()
{
- //we will use ADO's builtin property charSet
+ if (!$this->_connectionID) {
+ return false;
+ }
$this->charSet = @pg_client_encoding($this->_connectionID);
if (!$this->charSet) {
return false;