예제 #1
0
 /**
  * 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__);
 }
예제 #2
0
 /**
  * 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;
     }
 }