Skip to content

Commit b02ed32

Browse files
committed
Merge pull request #366 from KpuTuK/patch-1
Join: do not add 'on' if using() condition is used
2 parents c0e3575 + 8cffc84 commit b02ed32

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

MysqliDb.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1225,7 +1225,9 @@ protected function _buildJoin()
12251225
$joinStr = $joinTable;
12261226
}
12271227

1228-
$this->_query .= " " . $joinType . " JOIN " . $joinStr . " on " . $joinCondition;
1228+
$this->_query .= " " . $joinType . " JOIN " . $joinStr .
1229+
(false === stripos('using', $joinCondition) ? " " : " on ")
1230+
. $joinCondition;
12291231
}
12301232
}
12311233

0 commit comments

Comments
 (0)