本文整理汇总了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);
}