public function multiquery($query, $params = []) {

		if(true === is_array($query)) {
			$query = implode(";\n", $query);
		}

		if(false === is_string($query)) {
			return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string or array, "%s" given', __METHOD__, gettype($query)), E_USER_ERROR);
		}

		$results = new ResultSet([], 'array');

		if(null === $this -> connection) {
			$this -> connect();
		}

		//Escape paramaters
		$query = $this -> escapeSql($query, $params);

		if($this -> connection -> multi_query($query)) {

			$array = [];

			do {

				if($result = $this -> connection -> use_result()) {

					while($row = $result -> fetch_array(MYSQLI_ASSOC)) {
						$array[] = $row;
					}

					$result -> close();
					$results -> append($array);
					$array = [];
				}
			}

			while($this -> connection -> more_results() && $this -> connection -> next_result());
		}

		return $results;
	}
public function multiquery($query, $params = []) {

		if(true === is_array($query)) {
			$query = implode(";\n", $query);
		}

		if(false === is_string($query)) {
			return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string or array, "%s" given', __METHOD__, gettype($query)), E_USER_ERROR);
		}

		$results = new ResultSet([], 'array');

		if(null === $this -> connection) {
			$this -> connect();
		}

		//Escape paramaters
		$query = $this -> escapeSql($query, $params);

		if($this -> connection -> multi_query($query)) {

			$array = [];

			do {

				if($result = $this -> connection -> use_result()) {

					while($row = $result -> fetch_array(MYSQLI_ASSOC)) {
						$array[] = $row;
					}

					$result -> close();
					$results -> append($array);
					$array = [];
				}
			}

			while($this -> connection -> more_results() && $this -> connection -> next_result());
		}

		return $results;
	}
public function multiquery ( $ query , $ params = [ ] ) { if ( true === is_array ( $ query ) ) { $ query = implode ( ";\n" , $ query ) ; } if ( false === is_string ( $ query ) ) { return trigger_error ( sprintf ( 'Argument 1 passed to %s() must be of the type string or array, "%s" given' , __METHOD__ , gettype ( $ query ) ) , E_USER_ERROR ) ; } $ results = new ResultSet ( [ ] , 'array' ) ; if ( null === $ this -> connection ) { $ this -> connect ( ) ; } //Escape paramaters
 $ query = $ this -> escapeSql ( $ query , $ params ) ; if ( $ this -> connection -> multi_query ( $ query ) ) { $ array = [ ] ; do { if ( $ result = $ this -> connection -> use_result ( ) ) { while ( $ row = $ result -> fetch_array ( MYSQLI_ASSOC ) ) { $ array [ ] = $ row ; } $ result -> close ( ) ; $ results -> append ( $ array ) ; $ array = [ ] ; } } while ( $ this -> connection -> more_results ( ) && $ this -> connection -> next_result ( ) ) ; } return $ results ; }
Execute a multiquery
@param string $query
@param array $params
@return sFire\Adapter\ResultSet
Execute a multiquery