public function queryMulti($sql) { if (!$this->mysqli) { $this->connect(); } if (is_array($sql)) { $sql = implode(PHP_EOL, $sql); } // in debug mode, we will output all queries launched to the database Sis::DEBUG and Sis::debugEcho('SQL Multi Query: ' . $sql); // deploy the query $result = $this->mysqli->multi_query($sql); if (!$result) { return false; } while ($this->mysqli->next_result()) { } return true; }
protected function debugEcho($arr, $table = null) { $msg = 'MongoDB Debug: '; if ($table === null) { $table = $this->c->getDatabaseName(); $table .= '.'; $table .= $this->table; } $msg .= $table; foreach ($arr as $el) { if (is_string($el)) { $msg .= $el; } else { $msg .= json_encode($el); } } $msg .= ';'; Sis::DEBUG and Sis::debugEcho($msg); }