diff --git a/src/sqlabstraction/implementations/query_select_sqlite.php b/src/sqlabstraction/implementations/query_select_sqlite.php index de6b0fb..c3809ab 100644 --- a/src/sqlabstraction/implementations/query_select_sqlite.php +++ b/src/sqlabstraction/implementations/query_select_sqlite.php @@ -171,13 +171,13 @@ private function buildRightJoins() $reversedConditions = array_reverse( $rJoinPart['conditions'] ); // adding first table. - list( $key, $val ) = each( $reversedTables ); + $val = current( $reversedTables ); $oneItemResult .= $val; - while ( list( $key, $nextCondition ) = each( $reversedConditions ) ) + foreach ( $reversedConditions as $key => $nextCondition ) { - list( $key2, $nextTable ) = each( $reversedTables ); - $oneItemResult .= " LEFT JOIN {$nextTable} ON {$nextCondition}"; + $nextTable = next( $reversedTables ); + $oneItemResult .= " LEFT JOIN {$nextTable} ON {$nextCondition}"; } $resultArray[] = $oneItemResult; }