MyBB Community Forums

Full Version: Data Seeking with SQLite
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
The DB classes have a function "data_seek", which looks like this for SQLite (located in the PDO Class, but called without any modifications):

	function seek($query, $row)
	{
		$this->seek_array[$query->guid] = array('offset' => PDO::FETCH_ORI_ABS, 'row' => $row);
	}

And that array is then checked in "fetch_array". However as we're working with PDO here "query" doesn't return an instance of "resource" as the doc blocks say but an instance of "PDOStatement". And that class hasn't a variable named "guid".

I don't know whether we use that function in the core and haven't tested it but from the code this shouldn't work.
Also the check in "fetch_array" is stupid:
		if($this->seek_array[$query->guid])
		{
			$array = $query->fetch($resulttype, $this->seek[$query->guid]['offset'], $this->seek[$query->guid]['row']);
		}
Just noticed: We're adding that field ourself in query()
		$query->guid = $this->queries;

Doesn't seem like the best solution to me, but will reject this and fix the second one.