本文整理汇总了PHP中JDatabase::loadResultArray方法的典型用法代码示例。如果您正苦于以下问题:PHP JDatabase::loadResultArray方法的具体用法?PHP JDatabase::loadResultArray怎么用?PHP JDatabase::loadResultArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JDatabase
的用法示例。
在下文中一共展示了JDatabase::loadResultArray方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _anynomousAllowed
protected function _anynomousAllowed()
{
$result = array();
$query = "SELECT id\n\t\t\t\t\t\t\tFROM #__kunena_categories\n\t\t\t\t\t\t\tWHERE allow_anonymous=1;";
$this->_db->setQuery($query);
$allow_anonymous = $this->_db->loadResultArray();
if ($this->_db->getErrorNum()) {
$result = array('status' => '-1', 'error' => KunenaError::getDatabaseError());
} else {
$result['status'] = '1';
$result['allowed_anonymous'] = $allow_anonymous;
}
return $result;
}
示例2: jotcache_upgrade
function jotcache_upgrade(JDatabase $db)
{
$message = '';
$query = $db->getQuery(true);
$query->select('COUNT(*)')->from('#__jotcache_exclude')->where('type=1');
$tplex_count = $db->setQuery($query)->loadResult();
if ($tplex_count == 0) {
return false;
}
$query->clear('where');
$query->where('type=4');
$count = $db->setQuery($query)->loadResult();
if ($count == 0) {
$query->clear('select')->clear('where');
$query->select($db->quoteName('value'))->from($db->quoteName('#__template_styles', 's'))->where('name=s.id')->where('type=1')->order('s.home');
$defs = $db->setQuery($query)->loadResultArray();
$positions = array();
foreach ($defs as $def) {
$def_array = unserialize($def);
$positions = array_merge($positions, $def_array);
}
$query->clear();
$query->select('position')->from('#__modules')->where('client_id = 0')->where('published = 1')->where('position <>' . $db->quote(''))->group('position')->order('position');
$db->setQuery($query);
$items = $db->loadResultArray();
$cleaned_positions = array();
foreach ($items as $item) {
if (array_key_exists($item, $positions)) {
$cleaned_positions[$item] = $positions[$item];
}
}
$defs = serialize($cleaned_positions);
$query->clear();
$query->insert('#__jotcache_exclude')->columns('name,value,type')->values('1,' . $db->quote($defs) . ',4');
if ($db->setQuery($query)->query()) {
$message = "TABLE #__jotcache_exclude has been upgraded. Check JotCache TPL exclude definitions for correct values.";
} else {
JError::raiseNotice(100, $db->getErrorMsg());
}
return $message;
}
}
示例3: 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);
}