當前位置: 首頁>>代碼示例>>PHP>>正文


PHP DbHelper::fetchOne方法代碼示例

本文整理匯總了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;
     }
 }
開發者ID:kevinsmasters,項目名稱:purecatskillsmarketplace,代碼行數:27,代碼來源:cls_newsletter.php

示例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;
 }
開發者ID:kevinsmasters,項目名稱:purecatskillsmarketplace,代碼行數:12,代碼來源:cls_generalmethods.php

示例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;
 }
開發者ID:kevinsmasters,項目名稱:purecatskillsmarketplace,代碼行數:18,代碼來源:cls_products.php


注:本文中的DbHelper::fetchOne方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。