本文整理汇总了PHP中JDatabase::nameQuote方法的典型用法代码示例。如果您正苦于以下问题:PHP JDatabase::nameQuote方法的具体用法?PHP JDatabase::nameQuote怎么用?PHP JDatabase::nameQuote使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JDatabase
的用法示例。
在下文中一共展示了JDatabase::nameQuote方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: save
/**
* Generic save function
*
* @access public
* @param array Source array for binding to class vars
* @param string Filter for the order updating
* @param mixed An array or space separated list of fields not to bind
* @returns TRUE if completely successful, FALSE if partially or not succesful.
*/
function save($source, $order_filter = '', $ignore = '')
{
if (!$this->bind($source, $ignore)) {
return false;
}
if (!$this->check()) {
return false;
}
if (!$this->store()) {
return false;
}
if (!$this->checkin()) {
return false;
}
if ($order_filter) {
$filter_value = $this->{$order_filter};
$this->reorder($order_filter ? $this->_db->nameQuote($order_filter) . ' = ' . $this->_db->Quote($filter_value) : '');
}
$this->setError('');
return true;
}
示例2: _getAutoComplete
protected function _getAutoComplete($do, $data)
{
$result = array();
// only registered users when the board is online will endup here
// Verify permissions
if ($this->_session->allowed && $this->_session->allowed != 'na') {
$allowed = "c.id IN ({$this->_session->allowed})";
} else {
$allowed = "c.published='1' AND c.pub_access='0'";
}
// When we query for topics or categories we have to check against permissions
switch ($do) {
case 'getcat':
$query = "SELECT c.name, c.id\n\t\t\t\t\t\t\tFROM #__kunena_categories AS c\n\t\t\t\t\t\t\tWHERE {$allowed} AND name LIKE '" . $data . "%'\n\t\t\t\t\t\t\tORDER BY 1 LIMIT 0, 10;";
$this->_db->setQuery($query);
$result = $this->_db->loadResultArray();
break;
case 'gettopic':
$query = "SELECT m.subject\n\t\t\t\t\t\t\tFROM #__kunena_messages AS m\n\t\t\t\t\t\t\tJOIN #__kunena_categories AS c ON m.catid = c.id\n\t\t\t\t\t\t\tWHERE m.hold=0 AND m.parent=0 AND {$allowed}\n\t\t\t\t\t\t\t\tAND m.subject LIKE '" . $data . "%'\n\t\t\t\t\t\t\tORDER BY 1 LIMIT 0, 10;";
$this->_db->setQuery($query);
$result = $this->_db->loadResultArray();
break;
case 'getuser':
$kunena_config = KunenaFactory::getConfig();
// User the configured display name
$queryname = $kunena_config->username ? 'username' : 'name';
// Exclude the main superadmin from the search for security purposes
$query = "SELECT {$this->_db->nameQuote($queryname)} FROM #__users WHERE block=0 AND `id` != 62 AND {$this->_db->nameQuote($queryname)}\n\t\t\t\t\t\t\tLIKE {$this->_db->Quote("{$data}%")} ORDER BY 1 LIMIT 0, 10;";
$this->_db->setQuery($query);
$result = $this->_db->loadResultArray();
break;
default:
// Operation not supported
$result = array('status' => '-1', 'error' => JText::_('COM_KUNENA_AJAX_INVALID_OPERATION'));
}
if ($this->_db->getErrorNum()) {
$result = array('status' => '-1', 'error' => KunenaError::getDatabaseError());
}
return $result;
}