Well, I managed to find a "clean" solution using a code connection, install, etc. So it's great that you will have all the benefits of CI when using $ this-> db-> join (), $ this-> db-> join (), etc., for example, escaping and adding quotes.
So first do all your CI stuff:
$this->db->join(..)
Then you can create a query using the predefined, cleared, and shielded Active Record query elements:
// JOIN $sql = "UPDATE $this->baseTable "; $sql .= implode(' ', $this->db->ar_join); // SET $sql .= ' SET'; $setArray = array(); foreach ($this->db->ar_set as $column=>$newValue) array_push($setArray, " $column = $newValue"); $sql .= implode(',', $setArray); // WHERE $sql .= ' WHERE '.implode(' ', $this->db->ar_where); $this->db->query($sql);
If anyone has a better solution, I will gladly accept it and use it
source share