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