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


PHP Mysql::getConnection方法代码示例

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


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

示例1: GetPagesDataArray

 public function GetPagesDataArray($hidden = false)
 {
     $pagesData = array();
     $mainCounter = 0;
     $subCounter = 0;
     $database = Mysql::getConnection();
     if ($hidden == false) {
         $data = $database->Query("SELECT * FROM " . TABLE_PREFIX . "pages WHERE pageParent='0' AND pageShow='1' ORDER BY pagePosition ASC;");
     } else {
         if ($hidden == true) {
             $data = $database->Query("SELECT * FROM " . TABLE_PREFIX . "pages WHERE pageParent='0' ORDER BY pagePosition ASC;");
         }
     }
     while ($row = $data->fetch_array()) {
         $pageId = $row["pageId"];
         $parentPage = new Page();
         $parentPage->GetInfo($pageId);
         $pagesData[$mainCounter][$subCounter]["pageId"] = $parentPage->pageId;
         $pagesData[$mainCounter][$subCounter]["pageTitle"] = $parentPage->pageTitle;
         $pagesData[$mainCounter][$subCounter]["pageType"] = $parentPage->pageType;
         $subPageData = $database->Query("SELECT * FROM " . TABLE_PREFIX . "pages WHERE pageParent='{$parentPage->pageId}' AND pageShow='1' ORDER BY pagePosition ASC;");
         while ($subRow = $subPageData->fetch_array()) {
             $subPageId = $subRow["pageId"];
             $subPage = new Page();
             $subPage->GetInfo($subPageId);
             $subCounter++;
             $pagesData[$mainCounter][$subCounter]["pageId"] = $subPage->pageId;
             $pagesData[$mainCounter][$subCounter]["pageTitle"] = $subPage->pageTitle;
             $pagesData[$mainCounter][$subCounter]["pageType"] = $parentPage->pageType;
         }
         $subCounter = 0;
         $mainCounter++;
     }
     return $pagesData;
 }
开发者ID:tommmic,项目名称:inne,代码行数:35,代码来源:class-page.php

示例2: delete

 public function delete()
 {
     if ($this->id != null) {
         $database = Mysql::getConnection();
         $database->Query("DELETE FROM " . TABLE_PREFIX . "m_actualities WHERE id='{$this->id}';");
     }
 }
开发者ID:tommmic,项目名称:inne,代码行数:7,代码来源:class-actualities.php

示例3: Register

 public function Register($userNickname, $userPasswd, $userEmail)
 {
     $database = Mysql::getConnection();
     $userNickname = $database->handler->real_escape_string($userNickname);
     $userEmail = $database->handler->real_escape_string($userEmail);
     $userPasswd = $this->PasswdHash($userPasswd);
     $database->Query("INSERT INTO " . TABLE_PREFIX . "users VALUES ('', '{$userNickname}', '{$userEmail}', '', '{$userPasswd}');");
 }
开发者ID:tommmic,项目名称:inne,代码行数:8,代码来源:class-user.php

示例4: delete

 /**
  * @return bool
  */
 public function delete()
 {
     if ($this->id != "") {
         $database = Mysql::getConnection();
         $database->Query("DELETE FROM " . TABLE_PREFIX . "m_gallery WHERE id='{$this->id}';");
         return true;
     }
     return false;
 }
开发者ID:tommmic,项目名称:inne,代码行数:12,代码来源:class-gallery.php

示例5: Install

 public static function Install($template)
 {
     require_once ABS_PATH . '/temp/' . $template . '/install.php';
     $database = Mysql::getConnection();
     $database->Query("INSERT INTO " . TABLE_PREFIX . "templates VALUES ('', '" . $installData['templateName'] . "', '" . $installData['templateAuthor'] . "', '" . $installData['templateVersion'] . "', '0','" . $installData['templateDescription'] . "');");
     $debug = new Debug();
     $debug->debugType = 0;
     $debug->debugMessage = Lang::$langData['installTemplate'] . " (" . $template . ")";
     $debug->StartDebug();
 }
开发者ID:tommmic,项目名称:inne,代码行数:10,代码来源:class-template.php

示例6: TemplateLoader

 private function TemplateLoader()
 {
     $tempFiles = scandir(ABS_PATH . '/temp/');
     for ($i = 2; $i < count($tempFiles); $i++) {
         $database = Mysql::getConnection();
         $query = $database->Query("SELECT * FROM " . TABLE_PREFIX . "templates WHERE templateName='{$tempFiles[$i]}';");
         if (!$query->num_rows) {
             Template::Install($tempFiles[$i]);
         }
     }
 }
开发者ID:tommmic,项目名称:inne,代码行数:11,代码来源:class-adm.php

示例7: delete

 /**
  * @return bool
  */
 public function delete()
 {
     if ($this->id != "") {
         $database = Mysql::getConnection();
         $database->Query("DELETE FROM " . TABLE_PREFIX . "m_gallery_pictures WHERE id='{$this->id}';");
         if (file_exists(ABS_PATH . "/upload/modules/gallery/" . $this->file)) {
             unlink(ABS_PATH . "/upload/modules/gallery/" . $this->file);
         }
         return true;
     }
     return false;
 }
开发者ID:tommmic,项目名称:inne,代码行数:15,代码来源:class-picture.php

示例8: GenerateDataArray

 public function GenerateDataArray()
 {
     $database = Mysql::getConnection();
     if ($this->onlyVisible) {
         $data = $database->Query("SELECT * FROM " . TABLE_PREFIX . "pages WHERE pageShow='1' AND pageParent='0' ORDER BY pagePosition ASC;");
     } else {
         $data = $database->Query("SELECT * FROM " . TABLE_PREFIX . "pages WHERE pageParent='0' ORDER BY pagePosition ASC;");
     }
     while ($row = $data->fetch_array()) {
         $pageId = $row["pageId"];
         $parentPage = new Page();
         $parentPage->GetInfo($pageId);
         if ($database->Query("SELECT * FROM " . TABLE_PREFIX . "modules WHERE moduleName='simpleRoutes' AND moduleStatus='1';")->num_rows) {
             $routeQuery = $database->Query("SELECT routeVal FROM " . TABLE_PREFIX . "m_routes WHERE routeParamGET='p={$parentPage->pageId}';");
             while ($rData = $routeQuery->fetch_array()) {
                 $pageRoute = $rData["routeVal"];
             }
         }
         if (isset($pageRoute)) {
             $this->menu[$this->mainCounter][$this->subCounter]["pageAddress"] = WEBSITE_ADDRESS . substr($pageRoute, 1);
         } else {
             $this->menu[$this->mainCounter][$this->subCounter]["pageAddress"] = "index.php?p=" . $parentPage->pageId;
         }
         unset($pageRoute);
         $this->menu[$this->mainCounter][$this->subCounter]["pageId"] = $parentPage->pageId;
         $this->menu[$this->mainCounter][$this->subCounter]["pageTitle"] = $parentPage->pageTitle;
         $subPageData = $database->Query("SELECT * FROM " . TABLE_PREFIX . "pages WHERE pageParent='{$parentPage->pageId}' ORDER BY pagePosition ASC;");
         while ($subRow = $subPageData->fetch_array()) {
             $subPageId = $subRow["pageId"];
             $subPage = new Page();
             $subPage->GetInfo($subPageId);
             $this->subCounter++;
             if ($database->Query("SELECT * FROM " . TABLE_PREFIX . "modules WHERE moduleName='simpleRoutes' AND moduleStatus='1';")->num_rows) {
                 $routeQuery = $database->Query("SELECT routeVal FROM " . TABLE_PREFIX . "m_routes WHERE routeParamGET='p={$subPage->pageId}';");
                 while ($rData = $routeQuery->fetch_array()) {
                     $pageRoute = $rData["routeVal"];
                 }
             }
             if (isset($pageRoute)) {
                 $this->menu[$this->mainCounter][$this->subCounter]["pageAddress"] = WEBSITE_ADDRESS . substr($pageRoute, 1);
             } else {
                 $this->menu[$this->mainCounter][$this->subCounter]["pageAddress"] = "index.php?p=" . $subPage->pageId;
             }
             unset($pageRoute);
             $this->menu[$this->mainCounter][$this->subCounter]["pageId"] = $subPage->pageId;
             $this->menu[$this->mainCounter][$this->subCounter]["pageTitle"] = $subPage->pageTitle;
         }
         $this->subCounter = 0;
         $this->mainCounter++;
     }
     return $this->menu;
 }
开发者ID:tommmic,项目名称:inne,代码行数:52,代码来源:class-m-menu.php

示例9: defined

<?php

/*
 *	@author: Tomáš Mičulka
 *	@version: 2.0
 *	@last_update: 15.4.2014 
 */
defined('IN_INNE') or die("Acces denied!");
$database = Mysql::getConnection();
$getToken = $_GET["token"];
$user = User::getInstance();
if ($user->userToken == $getToken && $user->userPerm == 5) {
    $moduleId = $database->handler->real_escape_string($_POST["id"]);
    $module = new Module();
    $module->GetInfo($moduleId);
    if ($module->moduleStatus == 1) {
        $module->DisableModule();
    } else {
        $module->EnableModule();
    }
}
开发者ID:tommmic,项目名称:inne,代码行数:21,代码来源:moduleStatus.php

示例10: DeleteRouteGet

 public function DeleteRouteGet($paramGet)
 {
     $database = Mysql::getConnection();
     //$data = $database->Query("SELECT * FROM ".TABLE_PREFIX."m_routes WHERE routeParamGet='$paramGet';");
     $database->Query("DELETE FROM " . TABLE_PREFIX . "m_routes WHERE routeParamGet='{$paramGet}';");
 }
开发者ID:tommmic,项目名称:inne,代码行数:6,代码来源:class-route.php

示例11: SaveModule

 public function SaveModule()
 {
     $database = Mysql::getConnection();
     $database->Query("INSERT INTO " . TABLE_PREFIX . "modules VALUES (''," . " '{$this->moduleName}'," . " '{$this->moduleVersion}'," . " '{$this->moduleAuthor}'," . " '{$this->moduleDescription}'," . " '{$this->moduleType}'," . " '{$this->modulePriority}'," . " '{$this->moduleAutoStart}'," . " '{$this->moduleStatus}'," . " '{$this->moduleStyles}'," . " '{$this->moduleIcon}'," . " '{$this->moduleAdmin}'," . " '{$this->moduleAdminMenu}');");
 }
开发者ID:tommmic,项目名称:inne,代码行数:5,代码来源:class-module.php

示例12: LogEntry

 public function LogEntry()
 {
     $database = Mysql::getConnection();
     $details = json_decode(file_get_contents("http://ipinfo.io/"));
     $clientIp = $details->ip;
     $clientCity = $details->city;
     $clientCountry = $details->country;
     $date = time();
     $data = $database->Query("SELECT * FROM " . TABLE_PREFIX . "uniqueclients WHERE clientIp='{$clientIp}' AND clientCity='{$clientCity}' AND clientCountry='{$clientCountry}';");
     if ($data->num_rows == 0) {
         $database->Query("INSERT INTO " . TABLE_PREFIX . "uniqueclients VALUES ('', '{$clientIp}', '{$clientCity}', '{$clientCountry}');");
     }
     $database->Query("INSERT INTO " . TABLE_PREFIX . "visits VALUES ('', '{$date}', '{$clientIp}', '{$clientCity}', '{$clientCountry}');");
 }
开发者ID:tommmic,项目名称:inne,代码行数:14,代码来源:class-system.php


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