src/Neuron/DB/MySQL.php
public function query ($sSQL)
	{
		$this->addQueryLog ($sSQL);

		$this->connect ();

		// Increase the counter
		$this->query_counter ++;

		$result = $this->connection->query ($sSQL);

		if (!$result)
		{
			throw new Exception ('MySQL Error: '.$this->connection->error);
		}

		elseif ($result instanceof MySQLi_Result)
		{
			return new Neuron_DB_Result ($result);
		}

		// Insert ID will return zero if this query was not insert or update.
		$this->insert_id = intval ($this->connection->insert_id);

		// Affected rows
		$this->affected_rows = intval ($this->connection->affected_rows);

		if ($this->insert_id > 0)
			return $this->insert_id;

		if ($this->affected_rows > 0)
			return $this->affected_rows;

		return $result;
	}
public function query ($sSQL)
	{
		$this->addQueryLog ($sSQL);

		$this->connect ();

		// Increase the counter
		$this->query_counter ++;

		$result = $this->connection->query ($sSQL);

		if (!$result)
		{
			throw new Exception ('MySQL Error: '.$this->connection->error);
		}

		elseif ($result instanceof MySQLi_Result)
		{
			return new Neuron_DB_Result ($result);
		}

		// Insert ID will return zero if this query was not insert or update.
		$this->insert_id = intval ($this->connection->insert_id);

		// Affected rows
		$this->affected_rows = intval ($this->connection->affected_rows);

		if ($this->insert_id > 0)
			return $this->insert_id;

		if ($this->affected_rows > 0)
			return $this->affected_rows;

		return $result;
	}
/*
Execute a query and return a result