本文整理汇总了PHP中SJB_DB::queryValue方法的典型用法代码示例。如果您正苦于以下问题:PHP SJB_DB::queryValue方法的具体用法?PHP SJB_DB::queryValue怎么用?PHP SJB_DB::queryValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SJB_DB
的用法示例。
在下文中一共展示了SJB_DB::queryValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: isDataValid
function isDataValid(&$errors)
{
$errors = array();
if ($this->name == '') {
$errors['Zip Code'] = 'EMPTY_VALUE';
}
$count = SJB_DB::queryValue("SELECT count(*) FROM `locations` WHERE `name` = ?s AND `country_sid` = ?s AND `state` = ?s AND `city` = ?s AND sid <> ?n ", $this->name, $this->country_sid, $this->state, $this->city, $this->sid);
if ($count) {
$errors['Zip Code'] = 'NOT_UNIQUE_VALUE';
}
if ($this->longitude == '') {
$errors['Longitude'] = 'EMPTY_VALUE';
} elseif (!is_numeric($this->longitude)) {
$errors['Longitude'] = 'NOT_FLOAT_VALUE';
}
if ($this->latitude == '') {
$errors['Latitude'] = 'EMPTY_VALUE';
} elseif (!is_numeric($this->latitude)) {
$errors['Latitude'] = 'NOT_FLOAT_VALUE';
}
if ($this->country_sid == '') {
$errors['Country'] = 'EMPTY_VALUE';
}
return count($errors) == 0;
}
示例2: saveListingOnDB
public static function saveListingOnDB($listing_sid, $user_sid)
{
$record_exists = SJB_DB::queryValue("SELECT COUNT(*) FROM saved_listings WHERE user_sid = ?n AND listing_sid = ?n", $user_sid, $listing_sid);
if (!$record_exists) {
SJB_DB::query("INSERT INTO saved_listings SET listing_sid = ?n, user_sid = ?n", $listing_sid, $user_sid);
}
}
示例3: isAdminExist
public static function isAdminExist($username, $password)
{
$username = SJB_DB::quote($username);
$password = md5(SJB_DB::quote($password));
$value = SJB_DB::queryValue("SELECT * FROM `administrator` WHERE `username` = ?s AND `password` = '?w'", $username, $password);
return !empty($value);
}
示例4: getSavedAccessToken
/**
* @param $feedSID
* @return mixed|null
*/
public function getSavedAccessToken($feedSID)
{
if ($feedSID) {
$accessToken = SJB_DB::queryValue('SELECT `access_token` FROM `twitter_feeds` WHERE `sid` = ?s', $feedSID);
if (!empty($accessToken)) {
return unserialize($accessToken);
}
}
return null;
}
示例5: isSubAdminExist
public static function isSubAdminExist()
{
$username = SJB_DB::quote(SJB_Request::getVar('username'));
$password = md5(SJB_DB::quote(SJB_Request::getVar('password')));
$value = SJB_DB::queryValue("SELECT * FROM `subadmins` WHERE `username` = ?s AND `password` = '?w'", $username, $password);
if (empty($value)) {
return false;
}
return true;
}
示例6: saveListItem
public function saveListItem($list_item)
{
$item_sid = $list_item->getSID();
if (is_null($item_sid)) {
$max_order = SJB_DB::queryValue("SELECT MAX(`order`) FROM `" . $this->table_prefix . "_field_list` WHERE `field_sid` = ?n", $list_item->getFieldSID());
$max_order = empty($max_order) ? 0 : $max_order;
return SJB_DB::query("INSERT INTO `" . $this->table_prefix . "_field_list` SET `field_sid` = ?n, `value` = ?s, `order` = ?n, `score` = ?s", $list_item->getFieldSID(), $list_item->getValue(), ++$max_order, $list_item->score);
} else {
return SJB_DB::query("UPDATE `" . $this->table_prefix . "_field_list` SET `value` = ?s WHERE `sid` = ?n", $list_item->getValue(), $item_sid);
}
}
示例7: getItemsFromDB
public function getItemsFromDB($uri, $decorate = false)
{
$items = SJB_DB::queryValue("SELECT `data` FROM `browse` WHERE `page_uri` = ?s", $uri);
$items = unserialize($items);
if ($decorate) {
$searcherFactory = $this->searcherFactory;
$categorySearcher = $searcherFactory->getCategorySearcher($this->_getField());
$items = $categorySearcher->decorateItems($this->requestdata, $items);
}
return $items;
}
示例8: moveDownABdBySID
public static function moveDownABdBySID($ABSsid)
{
$ABInfo = SJB_DB::query("SELECT * FROM alphabet WHERE sid = ?n", $ABSsid);
if (empty($ABInfo)) {
return false;
}
$ABInfo = array_pop($ABInfo);
$current_order = $ABInfo['order'];
$less_order = SJB_DB::queryValue("SELECT MIN(`order`) FROM alphabet WHERE `order` > ?n", $current_order);
if ($less_order == 0) {
return false;
}
SJB_DB::query("UPDATE alphabet SET `order` = ?n WHERE `order` = ?n", $current_order, $less_order);
SJB_DB::query("UPDATE alphabet SET `order` = ?n WHERE sid = ?n", $less_order, $ABSsid);
return true;
}
示例9: moveDownItem
public function moveDownItem($item_sid)
{
$item_info = SJB_DB::query("SELECT * FROM {$this->table_prefix}_field_list WHERE sid = ?n", $item_sid);
if (empty($item_info)) {
return false;
}
$item_info = array_pop($item_info);
$current_order = $item_info['order'];
$field_sid = $item_info['field_sid'];
$less_order = SJB_DB::queryValue("SELECT MIN(`order`) FROM {$this->table_prefix}_field_list WHERE field_sid = ?n AND `order` > ?n", $field_sid, $current_order);
if (empty($less_order)) {
return false;
}
SJB_DB::query("UPDATE {$this->table_prefix}_field_list SET `order` = ?n WHERE field_sid = ?n AND `order` = ?n", $current_order, $field_sid, $less_order);
SJB_DB::query("UPDATE {$this->table_prefix}_field_list SET `order` = ?n WHERE sid = ?n", $less_order, $item_sid);
return true;
}
示例10: isValid
function isValid()
{
if (!preg_match("/^[a-zA-Z0-9\\._-]+@[a-zA-Z0-9\\._-]+\\.[a-zA-Z]{2,}\$/", $this->property_info['value']['original'])) {
return 'NOT_VALID_EMAIL_FORMAT';
}
if ($this->email_confirmation == 1 && $this->property_info['value']['original'] != $this->property_info['value']['confirmed']) {
return 'NOT_CONFIRMED';
}
if ($this->property_info['is_system']) {
$count = SJB_DB::queryValue("SELECT count(*) FROM ?w WHERE ?w = ?s AND sid <> ?n", $this->property_info['table_name'], $this->property_info['id'], $this->property_info['value']['original'], $this->object_sid);
} else {
$count = SJB_DB::queryValue("SELECT COUNT(*) FROM ?w WHERE id = ?s AND value = ?s AND object_sid <> ?n", $this->property_info['table_name'] . "_properties", $this->property_info['id'], $this->property_info['value']['original'], $this->object_sid);
}
if ($count) {
return 'NOT_UNIQUE_VALUE';
}
return true;
}
示例11: execute
public function execute()
{
$username = SJB_Request::getVar('username', '');
$password = SJB_Request::getVar('password', '');
$user_exists_by_username = SJB_DB::queryValue('SELECT count(*) FROM `users` WHERE `username` = ?s', $username);
if ($user_exists_by_username) {
$user_exists_by_password = SJB_DB::queryValue('SELECT count(*) FROM `users` WHERE `username` = ?s AND `password` = ?s', $username, $password);
if ($user_exists_by_password) {
$user_info = SJB_UserManager::getUserInfoByUserName($username);
if (!$user_info['active']) {
echo '<br>' . $username . '<br><br><font color="red">Your account is not active</font>';
}
} else {
echo '<br><font color="red">Incorrect username or/and password</font>';
}
} else {
echo '<br><font color="red">Incorrect username or/and password</font>';
}
exit;
}
示例12: getDefaultCountryByParentSID
public static function getDefaultCountryByParentSID($parentSID)
{
$result = SJB_DB::queryValue("SELECT `default_value` FROM `user_profile_fields` WHERE `id` = 'Country' AND `parent_sid` = ?n", $parentSID);
if ($result == 'default_country') {
return SJB_Settings::getSettingByName('default_country');
}
return $result;
}
示例13: getTotalContacts
/**
* Get count of contacts by user id
*
* @param integer $userID
* @return integer
*/
public static function getTotalContacts($userID)
{
return SJB_DB::queryValue('SELECT COUNT(*) FROM `private_message_contacts` WHERE `user_sid` = ?n', $userID);
}
示例14: isUserExistsByUserSid
public static function isUserExistsByUserSid($userSid)
{
return SJB_DB::queryValue("SELECT count(*) FROM `users` WHERE `sid` = ?n LIMIT 1", $userSid);
}
示例15: send
/**
* send mailings
* @return boolean
*/
public function send()
{
$mailIndex = $this->checkIfMailingExists();
if ($mailIndex !== false) {
SJB_DB::query("DELETE FROM `mailing_info` WHERE `mailing_id` = ?n", $this->_mailingID);
foreach ($this->_aMailings[$mailIndex]['mail_arr'] as $val) {
$email = SJB_DB::queryValue('SELECT `email` FROM `users` WHERE `sid`=?n', $val['sid']);
if (!empty($email)) {
$query = 'INSERT INTO `mailing_info` (`mailing_id`, `email`, `username`, `status`) VALUES (?n, ?s, ?s, 0)';
SJB_DB::query($query, $this->_mailingID, $email, $val['username']);
}
}
return $this->sendToUndelivered();
}
return false;
}