@@ 739-744 (lines=6) @@ | ||
736 | $this->sql = null; |
|
737 | $this->query_type = self::REPLACE; |
|
738 | ||
739 | if (! is_null($table_name) && is_string($table_name)) { |
|
740 | $this->sql = "REPLACE INTO $table_name " . "(`" . implode("`,`", array_keys($params)) . "`)"; |
|
741 | } else { |
|
742 | throw (new Exception("Table name is not valid", E_ERROR)); |
|
743 | } |
|
744 | ||
745 | $this->sql .= " VALUES (" . implode(",", array_map([ |
|
746 | $this, |
|
747 | '_escape' |
|
@@ 774-779 (lines=6) @@ | ||
771 | $this->sql = null; |
|
772 | $this->query_type = self::EXTENDED_REPLACE; |
|
773 | ||
774 | if (! is_null($table_name) && is_string($table_name)) { |
|
775 | $this->sql = "REPLACE INTO $table_name " . "(`" . implode("`,`", $fields) . "`)"; |
|
776 | } else { |
|
777 | throw (new Exception("Table name is not valid", E_ERROR)); |
|
778 | } |
|
779 | ||
780 | if (is_array($params) && count($params)) { |
|
781 | $this->sql .= " VALUES "; |
|
782 | foreach ($params as $p) { |