本文整理匯總了PHP中DbHelper::fetchOne方法的典型用法代碼示例。如果您正苦於以下問題:PHP DbHelper::fetchOne方法的具體用法?PHP DbHelper::fetchOne怎麽用?PHP DbHelper::fetchOne使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類DbHelper
的用法示例。
在下文中一共展示了DbHelper::fetchOne方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: addtoNewsLetterSubscriptionList
public static function addtoNewsLetterSubscriptionList($email = '')
{
global $tableprefix;
if (!empty($email)) {
// Check email address exists in subscribers list
$resCat = DbHelper::execute("SELECT nId FROM " . $tableprefix . "newsletter_subscribers WHERE vEmail ='" . mysql_real_escape_string($email) . "' ");
$data = DbHelper::fetchOne($resCat);
// If alraedy exists return false
if ($data) {
$emailSubscribed = 'exists';
} else {
// Insert Email id to subscriberlist
$resInsert = DbHelper::execute("INSERT INTO " . $tableprefix . "newsletter_subscribers\n (vEmail)VALUES('" . mysql_real_escape_string($email) . "')");
$constantcontactSettings = getconstantcontactSettings();
$_SESSION['constantaction'] = 'Add Email';
$userinfo = array();
$userinfo['emailAddress'] = mysql_real_escape_string($email);
$userinfo['firstName'] = '';
$userinfo['lastName'] = '';
$userinfo['lists'] = array($constantcontactSettings['constantcontactlistId']);
$_SESSION['constantparam']['redirecturl'] = SITE_URL . '/checkout.php';
//header("location:".$constantcontactSettings['verificationURL']);
$emailSubscribed = 'added';
}
return $emailSubscribed;
}
}
示例2: getHelpdetailNavigationURL
public static function getHelpdetailNavigationURL($helpID)
{
global $tableprefix;
$navigationURL = $bindName = NULL;
if (!empty($productID)) {
$resSet = DbHelper::execute("SELECT htitle FROM " . $tableprefix . "help WHERE hid =" . $helpID);
$data = DbHelper::fetchOne($resSet);
$bindName = generalMethods::doTrimSeoNames(strtolower(stripslashes($data)));
$navigationURL = SITE_URL . "/help/" . $bindName . "/" . $helpID;
}
return $navigationURL;
}
示例3: getTaxPerByZipCode
public static function getTaxPerByZipCode($zipCode = 0, $state = "NY")
{
global $tableprefix;
$taxPercentage = 0;
if ($state == 'NY') {
//(t.CombinedRate + t.StateRate + t.CountyRate + t.CityRate + t.SpecialRate)
$query = "SELECT (t.CombinedRate) as totaltax FROM " . $tableprefix . "taxrate_ny t WHERE t.ZipCode = '" . mysql_real_escape_string($zipCode) . "'";
$resCat = DbHelper::execute($query);
$data = DbHelper::fetchOne($resCat);
/*if($data == "" || $data == "0"){
$data = 0.08875;
}*/
if ($data > 0) {
$taxPercentage = number_format($data, 4, ".", "");
}
}
return $taxPercentage;
}