当前位置: 首页>>代码示例>>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;未经允许,请勿转载。