From 10610b2f622686da253fa363c2bc7a12b56a9a69 Mon Sep 17 00:00:00 2001 From: KpuTuK Date: Tue, 24 Nov 2015 19:28:51 +0300 Subject: [PATCH 1/2] Deleted condition "or" method _buildJoin() --- MysqliDb.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MysqliDb.php b/MysqliDb.php index 00e01f83..c697a3ca 100644 --- a/MysqliDb.php +++ b/MysqliDb.php @@ -1225,7 +1225,7 @@ protected function _buildJoin() $joinStr = $joinTable; } - $this->_query .= " " . $joinType . " JOIN " . $joinStr . " on " . $joinCondition; + $this->_query .= " " . $joinType . " JOIN " . $joinStr . " " . $joinCondition; } } From 8cffc8459d49662d72afe5e009e9704b1ee9b64c Mon Sep 17 00:00:00 2001 From: KpuTuK Date: Wed, 25 Nov 2015 01:34:17 +0300 Subject: [PATCH 2/2] Added check condition --- MysqliDb.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/MysqliDb.php b/MysqliDb.php index c697a3ca..8d93a3ba 100644 --- a/MysqliDb.php +++ b/MysqliDb.php @@ -1225,7 +1225,9 @@ protected function _buildJoin() $joinStr = $joinTable; } - $this->_query .= " " . $joinType . " JOIN " . $joinStr . " " . $joinCondition; + $this->_query .= " " . $joinType . " JOIN " . $joinStr . + (false === stripos('using', $joinCondition) ? " " : " on ") + . $joinCondition; } }