First condition - post

Initial work
could we get a freeresult squeezed in here, maybe by adding:

```php
		$rows = $this->db->sql_fetchrowset($result);
		$this->db->sql_freeresult($result);

		return $rows;
```