当前位置: 首页>>代码示例>>PHP>>正文


PHP Db::free方法代码示例

本文整理汇总了PHP中PH7\Framework\Mvc\Model\Engine\Db::free方法的典型用法代码示例。如果您正苦于以下问题:PHP Db::free方法的具体用法?PHP Db::free怎么用?PHP Db::free使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PH7\Framework\Mvc\Model\Engine\Db的用法示例。


在下文中一共展示了Db::free方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: setClick

 /**
  * Adding an Advertisement Click.
  *
  * @param integer $iAdsId
  * @return void
  */
 public static function setClick($iAdsId)
 {
     $rStmt = Db::getInstance()->prepare('UPDATE' . Db::prefix('Ads') . 'SET clicks = clicks+1 WHERE adsId = :id LIMIT 1');
     $rStmt->bindValue(':id', $iAdsId, \PDO::PARAM_INT);
     $rStmt->execute();
     Db::free($rStmt);
 }
开发者ID:huangciyin,项目名称:pH7-Social-Dating-CMS,代码行数:13,代码来源:Ads.class.php

示例2: getMetaMain

 public static function getMetaMain($sLangId)
 {
     $oCache = (new Cache())->start(self::CACHE_GROUP, 'metaMain' . $sLangId, self::CACHE_TIME);
     // @return value of meta tags the database
     if (!($oData = $oCache->get())) {
         $sSql = 'SELECT * FROM' . Engine\Db::prefix('MetaMain') . 'WHERE langId = :langId';
         // Get meta data with the current language if it exists in the "MetaMain" table ...
         $rStmt = Engine\Db::getInstance()->prepare($sSql);
         $rStmt->bindParam(':langId', $sLangId, \PDO::PARAM_STR);
         $rStmt->execute();
         $oData = $rStmt->fetch(\PDO::FETCH_OBJ);
         // If the current language doesn't exist in the "MetaMain" table, we create a new table for the new language with default value
         if (empty($oData)) {
             $aData = ['langId' => $sLangId, 'pageTitle' => 'Home', 'metaDescription' => 'The Dating Software for creating online dating service or online social community.', 'metaKeywords' => 'script,CMS,PHP,dating script,dating software,social networking software,social networking script,social network script,free,open source,match clone,friend finder clone,adult friend finder clone', 'slogan' => 'pH7CMS is the leading Dating CMS specializes in online open source dating software!', 'metaRobots' => 'index, follow, all', 'metaAuthor' => 'Pierre-Henry Soria', 'metaCopyright' => 'Copyright Pierre-Henry Soria. All Rights Reserved.', 'metaRating' => 'general', 'metaDistribution' => 'global', 'metaCategory' => 'dating'];
             Engine\Record::getInstance()->insert('MetaMain', $aData);
             // Create the new meta data language
             $oData = (object) $aData;
             unset($aData);
         }
         Engine\Db::free($rStmt);
         $oCache->put($oData);
     }
     unset($oCache);
     return $oData;
 }
开发者ID:joswilson,项目名称:NotJustOK,代码行数:25,代码来源:DbConfig.class.php

示例3: get

 /**
  * Gets Viewed Profile.
  *
  * @param string $sGender Constant (self::ALL, self::COUPLE, self::MALE, self::FEMALE). Default: self::ALL
  * @param boolean $bCount Put TRUE for count birthdays or FALSE for the result of birthdays. Default: TRUE
  * @param string $sOrderBy Default: SearchCoreModel::LAST_ACTIVITY
  * @param string $sSort Default: SearchCoreModel::DESC
  * @param integer $iOffset Default: NULL
  * @param integer $iLimit Default: NULL
  * @return mixed (object | integer) object for the birthdays list returned or integer for the total number birthdays returned.
  */
 public function get($sGender = self::ALL, $bCount = false, $sOrderBy = SearchCoreModel::LAST_ACTIVITY, $sSort = SearchCoreModel::DESC, $iOffset = null, $iLimit = null)
 {
     $bIsLimit = null !== $iOffset && null !== $iLimit;
     $bIsSex = $sGender !== self::ALL;
     $bCount = (bool) $bCount;
     $iOffset = (int) $iOffset;
     $iLimit = (int) $iLimit;
     $sSqlLimit = !$bCount && $bIsLimit ? 'LIMIT :offset, :limit' : '';
     $sSqlSelect = !$bCount ? '*' : 'COUNT(profileId) AS totalBirths';
     $sSqlWhere = $bIsSex ? ' AND (sex = :sex) ' : '';
     $sSqlOrder = SearchCoreModel::order($sOrderBy, $sSort);
     $rStmt = Db::getInstance()->prepare('SELECT ' . $sSqlSelect . ' FROM' . Db::prefix('Members') . 'WHERE (username <> \'' . PH7_GHOST_USERNAME . '\') AND (groupId=\'2\') AND (birthDate LIKE :date)' . $sSqlWhere . $sSqlOrder . $sSqlLimit);
     $rStmt->bindValue(':date', '%' . (new CDateTime())->get()->date('-m-d'), \PDO::PARAM_STR);
     if ($bIsSex) {
         $rStmt->bindValue(':sex', $sGender, \PDO::PARAM_STR);
     }
     if (!$bCount && $bIsLimit) {
         $rStmt->bindParam(':offset', $iOffset, \PDO::PARAM_INT);
         $rStmt->bindParam(':limit', $iLimit, \PDO::PARAM_INT);
     }
     $rStmt->execute();
     if (!$bCount) {
         $oRow = $rStmt->fetchAll(\PDO::FETCH_OBJ);
         Db::free($rStmt);
         return $oRow;
     } else {
         $oRow = $rStmt->fetch(\PDO::FETCH_OBJ);
         Db::free($rStmt);
         return (int) $oRow->totalBirths;
     }
 }
开发者ID:nsrau,项目名称:pH7-Social-Dating-CMS,代码行数:42,代码来源:BirthdayCoreModel.php

示例4: getMetaMain

 public static function getMetaMain($sLangId)
 {
     $oCache = (new Cache())->start(self::CACHE_GROUP, 'metaMain' . $sLangId, self::CACHE_TIME);
     // @return value of meta tags the database
     if (!($oData = $oCache->get())) {
         $sSql = 'SELECT * FROM' . Engine\Db::prefix('MetaMain') . 'WHERE langId = :langId';
         // Get meta data with the current language if it exists in the "MetaMain" table ...
         $rStmt = Engine\Db::getInstance()->prepare($sSql);
         $rStmt->bindParam(':langId', $sLangId, \PDO::PARAM_STR);
         $rStmt->execute();
         $oData = $rStmt->fetch(\PDO::FETCH_OBJ);
         // If the current language doesn't exist in the "MetaMain" table, we create a new table for the new language with default value
         if (empty($oData)) {
             $aData = ['langId' => $sLangId, 'pageTitle' => 'Home', 'metaDescription' => 'The Dating Software for creating online dating service or online social community.', 'metaKeywords' => 'script,CMS,PHP,dating script,dating software,social networking software,social networking script,social network script,free,open source,match clone,friend finder clone,adult friend finder clone', 'slogan' => 'Free Online Dating Community Site with Chat Rooms', 'promoText' => 'You\'re on the best place for meeting new people nearby! Chat, Flirt, Socialize and have Fun!<br />Create any Dating Sites like that with the <a href="http://software.hizup.com">PHP Dating Script</a>. It is Professional, Free, Open Source, ...', 'metaRobots' => 'index, follow, all', 'metaAuthor' => 'Pierre-Henry Soria', 'metaCopyright' => 'Copyright Pierre-Henry Soria. All Rights Reserved.', 'metaRating' => 'general', 'metaDistribution' => 'global', 'metaCategory' => 'dating'];
             Engine\Record::getInstance()->insert('MetaMain', $aData);
             // Create the new meta data language
             $oData = (object) $aData;
             unset($aData);
         }
         Engine\Db::free($rStmt);
         $oCache->put($oData);
     }
     unset($oCache);
     return $oData;
 }
开发者ID:nsrau,项目名称:pH7-Social-Dating-CMS,代码行数:25,代码来源:DbConfig.class.php

示例5: searchUser

 public function searchUser($mWhat, $sWhere, $iGroupId, $iBanned, $bCount, $sOrderBy, $sSort, $iOffset, $iLimit)
 {
     $bCount = (bool) $bCount;
     $iOffset = (int) $iOffset;
     $iLimit = (int) $iLimit;
     $sSqlLimit = !$bCount ? ' LIMIT :offset, :limit' : '';
     $sSqlSelect = !$bCount ? 'm.*, g.name AS membershipName' : 'COUNT(m.profileId) AS totalUsers';
     $sSqlQuery = !empty($iBanned) ? '(ban = 1) AND ' : '';
     $sSqlQuery .= $sWhere === 'all' ? '(m.username LIKE :what OR m.email LIKE :what OR m.firstName LIKE :what OR m.lastName LIKE :what OR m.ip LIKE :what)' : '(m.' . $sWhere . ' LIKE :what)';
     $sSqlOrder = SearchCoreModel::order($sOrderBy, $sSort);
     $rStmt = Db::getInstance()->prepare('SELECT ' . $sSqlSelect . ' FROM' . Db::prefix('Members') . 'AS m INNER JOIN ' . Db::prefix('Memberships') . 'AS g ON m.groupId = g.groupId LEFT JOIN' . Db::prefix('MembersInfo') . 'AS i ON m.profileId = i.profileId WHERE (username <> \'' . PH7_GHOST_USERNAME . '\') AND (m.groupId = :groupId) AND ' . $sSqlQuery . $sSqlOrder . $sSqlLimit);
     $rStmt->bindValue(':what', '%' . $mWhat . '%', \PDO::PARAM_STR);
     $rStmt->bindParam(':groupId', $iGroupId, \PDO::PARAM_INT);
     if (!$bCount) {
         $rStmt->bindParam(':offset', $iOffset, \PDO::PARAM_INT);
         $rStmt->bindParam(':limit', $iLimit, \PDO::PARAM_INT);
     }
     $rStmt->execute();
     if (!$bCount) {
         $oRow = $rStmt->fetchAll(\PDO::FETCH_OBJ);
         Db::free($rStmt);
         return $oRow;
     } else {
         $oRow = $rStmt->fetch(\PDO::FETCH_OBJ);
         Db::free($rStmt);
         return (int) $oRow->totalUsers;
     }
 }
开发者ID:huangciyin,项目名称:pH7-Social-Dating-CMS,代码行数:28,代码来源:AdminCoreModel.php

示例6: exec

 /**
  * @param string $sFile SQL file name.
  * @param string $sPath Path to SQL file.
  * @param array $aParams Default NULL
  * @return boolean Returns TRUE on success or FALSE on failure.
  */
 public function exec($sFile, $sPath, array $aParams = null)
 {
     $rStmt = Db::getInstance()->prepare($this->getQuery($sFile, $sPath));
     $bRet = $rStmt->execute($aParams);
     Db::free($rStmt);
     return $bRet;
 }
开发者ID:huangciyin,项目名称:pH7-Social-Dating-CMS,代码行数:13,代码来源:Model.class.php

示例7: totalReports

 public function totalReports()
 {
     $rStmt = Db::getInstance()->prepare('SELECT COUNT(reportId) AS totalRpts FROM' . Db::prefix('Report'));
     $rStmt->execute();
     $oRow = $rStmt->fetch(\PDO::FETCH_OBJ);
     Db::free($rStmt);
     return (int) $oRow->totalRpts;
 }
开发者ID:huangciyin,项目名称:pH7-Social-Dating-CMS,代码行数:8,代码来源:ReportModel.php

示例8: totalNotes

 public function totalNotes()
 {
     $rStmt = Db::getInstance()->prepare('SELECT COUNT(noteId) AS totalNotes FROM' . Db::prefix('Notes') . 'WHERE approved = \'0\'');
     $rStmt->execute();
     $oRow = $rStmt->fetch(\PDO::FETCH_OBJ);
     Db::free($rStmt);
     return (int) $oRow->totalNotes;
 }
开发者ID:joswilson,项目名称:NotJustOK,代码行数:8,代码来源:ModeratorCoreModel.php

示例9: countUnreadMsg

 public static function countUnreadMsg($iProfileId)
 {
     $rStmt = Db::getInstance()->prepare('SELECT COUNT(status) AS unread FROM' . Db::prefix('Messages') . 'WHERE recipient = :recipient AND status = \'1\' AND NOT FIND_IN_SET(\'recipient\', toDelete)');
     $rStmt->bindValue(':recipient', $iProfileId, \PDO::PARAM_INT);
     $rStmt->execute();
     $oRow = $rStmt->fetch(\PDO::FETCH_OBJ);
     Db::free($rStmt);
     return (int) $oRow->unread;
 }
开发者ID:nsrau,项目名称:pH7-Social-Dating-CMS,代码行数:9,代码来源:MailCoreModel.php

示例10: totalFriends

 /**
  * Count total friends.
  *
  * @param integer $iProfileId
  * @return integer
  */
 public static function totalFriends($iProfileId)
 {
     $rStmt = Db::getInstance()->prepare('SELECT COUNT(friendId) AS totalFriends FROM' . Db::prefix('MembersFriends') . 'WHERE (profileId = :profileId OR friendId= :profileId)');
     $rStmt->bindValue(':profileId', $iProfileId, \PDO::PARAM_INT);
     $rStmt->execute();
     $oRow = $rStmt->fetch(\PDO::FETCH_OBJ);
     Db::free($rStmt);
     return (int) $oRow->totalFriends;
 }
开发者ID:joswilson,项目名称:NotJustOK,代码行数:15,代码来源:FriendCoreModel.php

示例11: setClick

 /**
  * Adding an Advertisement Click.
  *
  * @param integer $iAdsId
  * @return void
  */
 public static function setClick($iAdsId)
 {
     $rStmt = Db::getInstance()->prepare('INSERT INTO' . Db::prefix('AdsClicks') . 'SET adsId = :adsId, url = :url, ip = :ip, dateTime = :dateTime');
     $rStmt->bindValue(':adsId', $iAdsId, \PDO::PARAM_INT);
     $rStmt->bindValue(':ip', \PH7\Framework\Ip\Ip::get(), \PDO::PARAM_STR);
     $rStmt->bindValue(':dateTime', (new \PH7\Framework\Date\CDateTime())->get()->dateTime('Y-m-d H:i:s'), \PDO::PARAM_STR);
     $rStmt->execute();
     Db::free($rStmt);
 }
开发者ID:joswilson,项目名称:NotJustOK,代码行数:15,代码来源:Ads.class.php

示例12: getView

 /**
  * This method was created to avoid retrieving the column "views" with the general Model of the module,
  * since it uses the cache and therefore cannot retrieve the number of real-time views.
  *
  * @param integer $iId
  * @param string $sTable
  * @return integer Number of views.
  */
 public static function getView($iId, $sTable)
 {
     $sWhere = Various::convertTableToId($sTable);
     $rStmt = Db::getInstance()->prepare('SELECT views FROM' . Db::prefix($sTable) . 'WHERE ' . $sWhere . ' = :id LIMIT 1');
     $rStmt->bindValue(':id', $iId, \PDO::PARAM_INT);
     $rStmt->execute();
     $oRow = $rStmt->fetch(\PDO::FETCH_OBJ);
     Db::free($rStmt);
     return (int) @$oRow->views;
 }
开发者ID:joswilson,项目名称:NotJustOK,代码行数:18,代码来源:Statistic.class.php

示例13: getForumsPosts

 public function getForumsPosts($sOrder, $iOffset, $iLimit)
 {
     $iOffset = (int) $iOffset;
     $iLimit = (int) $iLimit;
     $rStmt = Db::getInstance()->prepare('SELECT f.name, t.title, t.message, t.createdDate, t.updatedDate, t.forumId, t.topicId, m.username FROM' . Db::prefix('Forums') . 'AS f INNER JOIN' . Db::prefix('ForumsTopics') . 'AS t ON f.forumId = t.forumId LEFT JOIN' . Db::prefix('Members') . ' AS m ON t.profileId = m.profileId WHERE t.approved=1 ORDER BY ' . $sOrder . ' DESC LIMIT :offset, :limit');
     $rStmt->bindParam(':offset', $iOffset, \PDO::PARAM_INT);
     $rStmt->bindParam(':limit', $iLimit, \PDO::PARAM_INT);
     $rStmt->execute();
     $oData = $rStmt->fetchAll(\PDO::FETCH_OBJ);
     Db::free($rStmt);
     return $oData;
 }
开发者ID:nsrau,项目名称:pH7-Social-Dating-CMS,代码行数:12,代码来源:DataCoreModel.php

示例14: select

 public function select($sKey)
 {
     $this->cache->start(self::CACHE_GROUP, 'select' . $sKey, 3600 * 168);
     if (!($oData = $this->cache->get())) {
         $rStmt = Db::getInstance()->prepare('SELECT * FROM' . Db::prefix('Likes') . 'WHERE keyId =:key LIMIT 1');
         $rStmt->bindValue(':key', $sKey, \PDO::PARAM_STR);
         $rStmt->execute();
         $oData = $rStmt->fetchAll(\PDO::FETCH_OBJ);
         Db::free($rStmt);
         $this->cache->put($oData);
     }
     return $oData;
 }
开发者ID:nsrau,项目名称:pH7-Social-Dating-CMS,代码行数:13,代码来源:LikeCoreModel.php

示例15: getInfos

 /**
  * Get information about the language.
  *
  * @param boolean $bOnlyActive Only active lang. Default: TRUE
  * @return object Language data.
  */
 public function getInfos($bOnlyActive = true)
 {
     $oCache = (new Cache())->start(self::CACHE_GROUP, 'list' . $bOnlyActive, 172800);
     if (!($oData = $oCache->get())) {
         $sSqlWhere = $bOnlyActive ? 'WHERE active=\'1\'' : '';
         $rStmt = Db::getInstance()->prepare('SELECT * FROM ' . DB::prefix('LanguagesInfo') . $sSqlWhere . ' ORDER BY name ASC');
         $rStmt->execute();
         $oData = $rStmt->fetchAll(\PDO::FETCH_OBJ);
         Db::free($rStmt);
         $oCache->put($oData);
     }
     unset($oCache);
     return $oData;
 }
开发者ID:huangciyin,项目名称:pH7-Social-Dating-CMS,代码行数:20,代码来源:Lang.class.php


注:本文中的PH7\Framework\Mvc\Model\Engine\Db::free方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。