/** * Test loadResult method * * @return void * * @since 11.4 */ public function testLoadResult() { $query = $this->object->getQuery(true); $query->select('id'); $query->from('jos_dbtest'); $query->where('title=' . $this->object->quote('Testing2')); $this->object->setQuery($query); $result = $this->object->loadResult(); $this->assertThat($result, $this->equalTo(2), __LINE__); }
/** * Loads the first field of the first row returned by the query. * * @throws SPException * @return string */ public function loadResult() { try { $r = $this->db->loadResult(); $this->count++; } catch (Exception $e) { } if ($this->db->getErrorNum()) { throw new SPException($this->db->stderr()); } else { return $r; } }