summaryrefslogtreecommitdiffstats
path: root/system/database/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'system/database/drivers')
-rw-r--r--system/database/drivers/cubrid/cubrid_driver.php2
-rw-r--r--system/database/drivers/mssql/mssql_driver.php4
-rw-r--r--system/database/drivers/mysql/mysql_driver.php2
-rw-r--r--system/database/drivers/mysqli/mysqli_driver.php12
-rw-r--r--system/database/drivers/odbc/odbc_driver.php6
-rw-r--r--system/database/drivers/sqlite/sqlite_driver.php2
6 files changed, 14 insertions, 14 deletions
diff --git a/system/database/drivers/cubrid/cubrid_driver.php b/system/database/drivers/cubrid/cubrid_driver.php
index b7763d90f..971f1ea7b 100644
--- a/system/database/drivers/cubrid/cubrid_driver.php
+++ b/system/database/drivers/cubrid/cubrid_driver.php
@@ -74,7 +74,7 @@ class CI_DB_cubrid_driver extends CI_DB {
else
{
// If no port is defined by the user, use the default value
- $this->port === '' OR $this->port = 33000;
+ empty($this->port) OR $this->port = 33000;
}
}
diff --git a/system/database/drivers/mssql/mssql_driver.php b/system/database/drivers/mssql/mssql_driver.php
index 5bd666960..697b2fd28 100644
--- a/system/database/drivers/mssql/mssql_driver.php
+++ b/system/database/drivers/mssql/mssql_driver.php
@@ -64,7 +64,7 @@ class CI_DB_mssql_driver extends CI_DB {
*/
public function db_connect()
{
- if ($this->port !== '')
+ if ( ! empty($this->port))
{
$this->hostname .= ','.$this->port;
}
@@ -81,7 +81,7 @@ class CI_DB_mssql_driver extends CI_DB {
*/
public function db_pconnect()
{
- if ($this->port !== '')
+ if ( ! empty($this->port))
{
$this->hostname .= ','.$this->port;
}
diff --git a/system/database/drivers/mysql/mysql_driver.php b/system/database/drivers/mysql/mysql_driver.php
index fc9bbdc4e..5937b223b 100644
--- a/system/database/drivers/mysql/mysql_driver.php
+++ b/system/database/drivers/mysql/mysql_driver.php
@@ -68,7 +68,7 @@ class CI_DB_mysql_driver extends CI_DB {
{
parent::__construct($params);
- if ($this->port !== '')
+ if ( ! empty($this->port))
{
$this->hostname .= ':'.$this->port;
}
diff --git a/system/database/drivers/mysqli/mysqli_driver.php b/system/database/drivers/mysqli/mysqli_driver.php
index 5814aceb9..02f893755 100644
--- a/system/database/drivers/mysqli/mysqli_driver.php
+++ b/system/database/drivers/mysqli/mysqli_driver.php
@@ -71,9 +71,9 @@ class CI_DB_mysqli_driver extends CI_DB {
*/
public function db_connect()
{
- return ($this->port !== '')
- ? @new mysqli($this->hostname, $this->username, $this->password, $this->database, $this->port)
- : @new mysqli($this->hostname, $this->username, $this->password, $this->database);
+ return empty($this->port)
+ ? @new mysqli($this->hostname, $this->username, $this->password, $this->database)
+ : @new mysqli($this->hostname, $this->username, $this->password, $this->database, $this->port);
}
// --------------------------------------------------------------------
@@ -91,9 +91,9 @@ class CI_DB_mysqli_driver extends CI_DB {
return $this->db_connect();
}
- return ($this->port !== '')
- ? @new mysqli('p:'.$this->hostname, $this->username, $this->password, $this->database, $this->port)
- : @new mysqli('p:'.$this->hostname, $this->username, $this->password, $this->database);
+ return empty($this->port)
+ ? @new mysqli('p:'.$this->hostname, $this->username, $this->password, $this->database)
+ : @new mysqli('p:'.$this->hostname, $this->username, $this->password, $this->database, $this->port);
}
// --------------------------------------------------------------------
diff --git a/system/database/drivers/odbc/odbc_driver.php b/system/database/drivers/odbc/odbc_driver.php
index b493e9335..c3735da05 100644
--- a/system/database/drivers/odbc/odbc_driver.php
+++ b/system/database/drivers/odbc/odbc_driver.php
@@ -64,7 +64,7 @@ class CI_DB_odbc_driver extends CI_DB {
$this->_random_keyword = ' RND('.time().')'; // database specific random keyword
// Legacy support for DSN in the hostname field
- if ($this->dsn === '')
+ if (empty($this->dsn))
{
$this->dsn = $this->hostname;
}
@@ -254,9 +254,9 @@ class CI_DB_odbc_driver extends CI_DB {
*/
protected function _list_tables($prefix_limit = FALSE)
{
- $sql = "SHOW TABLES FROM `".$this->database."`";
+ $sql = 'SHOW TABLES FROM '.$this->database;
- if ($prefix_limit !== FALSE AND $this->dbprefix !== '')
+ if ($prefix_limit !== FALSE && $this->dbprefix !== '')
{
//$sql .= " LIKE '".$this->escape_like_str($this->dbprefix)."%' ".sprintf($this->_like_escape_str, $this->_like_escape_chr);
return FALSE; // not currently supported
diff --git a/system/database/drivers/sqlite/sqlite_driver.php b/system/database/drivers/sqlite/sqlite_driver.php
index c87a16ba8..d9820e1b3 100644
--- a/system/database/drivers/sqlite/sqlite_driver.php
+++ b/system/database/drivers/sqlite/sqlite_driver.php
@@ -279,7 +279,7 @@ class CI_DB_sqlite_driver extends CI_DB {
{
$sql = "SELECT name from sqlite_master WHERE type='table'";
- if ($prefix_limit !== FALSE AND $this->dbprefix != '')
+ if ($prefix_limit !== FALSE && $this->dbprefix != '')
{
$sql .= " AND 'name' LIKE '".$this->escape_like_str($this->dbprefix)."%' ".sprintf($this->_like_escape_str, $this->_like_escape_chr);
}