本文整理匯總了PHP中JDatabase::loadColumn方法的典型用法代碼示例。如果您正苦於以下問題:PHP JDatabase::loadColumn方法的具體用法?PHP JDatabase::loadColumn怎麽用?PHP JDatabase::loadColumn使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類JDatabase
的用法示例。
在下文中一共展示了JDatabase::loadColumn方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: find
/**
* Get items.
*
* Derived classes should generally override this function to return correct objects.
*
* @return array
*/
public function find()
{
if ($this->skip) {
return array();
}
$query = clone $this->query;
$this->build($query);
$query->select('a.' . $this->primaryKey);
$this->db->setQuery($query, $this->start, $this->limit);
$results = (array) $this->db->loadColumn();
KunenaError::checkDatabaseError();
return $results;
}
示例2: queryResultArray
/**
* Execute a query to the database and get an array of values from the <var>$numinarray</var> field in
* each row of the result set from the database query.
*
* The result returned by this method is the same as the one returned by JDatabase::loadColumn()
*
* @param string $query The query to be executed
* @param int $numinarray The offset of the result to get
*
* @return mixed The result of the query
*
* @throws RuntimeException
*
* @since 1.0.0
*/
public function queryResultArray($query, $numinarray = 0)
{
// query database table
$this->_database->setQuery($query);
return $this->_database->loadColumn($numinarray);
}
示例3: loadResultArray
/**
* Load an array of single field results into an array
*
* @param int $offset The row offset to use to build the result array
* @return array The array with the result (empty in case of error)
*
* @throws \RuntimeException
*/
public function loadResultArray($offset = 0)
{
return $this->_nullToArray($this->_db->loadColumn($offset));
}
示例4: loadResultArray
/**
* Load an array of single field results into an array
*/
function loadResultArray($numinarray = 0)
{
if (checkJversion() >= 2) {
$result = $this->_db->loadColumn($numinarray);
} else {
$result = $this->_db->loadResultArray($numinarray);
}
return $this->_nullToArray($result);
}