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


PHP DBConnector::getConnection方法代碼示例

本文整理匯總了PHP中DBConnector::getConnection方法的典型用法代碼示例。如果您正苦於以下問題:PHP DBConnector::getConnection方法的具體用法?PHP DBConnector::getConnection怎麽用?PHP DBConnector::getConnection使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在DBConnector的用法示例。


在下文中一共展示了DBConnector::getConnection方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getCareerByID

 public static function getCareerByID($id)
 {
     $resRow = array();
     $query_str = 'SELECT * FROM ' . Titles::$CAREER_TABLE_NAME . ' WHERE ' . Titles::$CAREER_ID . ' = ' . $id . '';
     $conn = DBConnector::getConnection();
     $resRow = $conn->query($query_str);
     $newList = $resRow->fetch();
     return $newList;
 }
開發者ID:FunnyBeardVODO,項目名稱:brige-v0.1,代碼行數:9,代碼來源:Career.php

示例2: registerClient

 public static function registerClient($name, $surname, $email, $password, $card)
 {
     $dataBase = DBConnector::getConnection();
     $card = self::getCardId($card);
     $sql = "INSERT INTO CLIENT (client_name, client_surname, client_email, client_password, card_id) VALUES ('{$name}', '{$surname}', '{$email}', '{$password}', '{$card}' )";
     $result = $dataBase->query($sql);
     if ($result == 'true') {
         echo "Ваши данные успешно добавлены";
     } else {
         echo $sql . '<br/>';
         echo "Ваши данные не добавлены" . '<br/>';
         var_dump($result);
     }
 }
開發者ID:DenisGoldiner,項目名稱:library,代碼行數:14,代碼來源:registration_model.php

示例3: getLoginData

 private static function getLoginData()
 {
     $newList = array();
     $conn = DBConnector::getConnection();
     $resultSet = $conn->query('Select * From Admins');
     if ($conn != null) {
         $i = 0;
         while ($row = $resultSet->fetch()) {
             $newList[$i][Titles::$USER_LOGIN] = $row['login'];
             $newList[$i][Titles::$USER_PASSWORD] = $row['password'];
             $i++;
         }
     }
     return $newList;
 }
開發者ID:FunnyBeardVODO,項目名稱:brige-v0.1,代碼行數:15,代碼來源:Admin.php

示例4: showAllArticles

 public static function showAllArticles()
 {
     $dataList = array();
     $resultSet = null;
     $query = 'SELECT * FROM ' . Titles::$ARTICLE_TABLE_NAME . ';';
     $connection = DBConnector::getConnection();
     $resultSet = $connection->query($query);
     if ($connection != null) {
         if ($resultSet != null) {
             $i = 0;
         }
         while ($row = $resultSet->fetch()) {
             $dataList[$i][Titles::$ARTICLE_TITLE] = $row[Titles::$ARTICLE_TITLE];
             $dataList[$i][Titles::$ARTICLE_TEXT_DATA] = $row[Titles::$ARTICLE_TEXT_DATA];
             $dataList[$i][Titles::$ARTICLE_PUBLICATION_DATE] = $row[Titles::$ARTICLE_PUBLICATION_DATE];
             $i++;
         }
     }
     return $dataList;
 }
開發者ID:FunnyBeardVODO,項目名稱:brige-v0.1,代碼行數:20,代碼來源:Article.php

示例5: getBooksList

 public static function getBooksList()
 {
     include_once src_path . '/classes/Book/Book.php';
     $booksList = array();
     $dataBase = DBConnector::getConnection();
     $result = $dataBase->query('SELECT * from book ORDER BY book_id');
     $i = 0;
     while ($row = $result->fetch()) {
         $booksList[$i]['book_id'] = $row['book_id'];
         $booksList[$i]['book_name'] = $row['book_name'];
         $booksList[$i]['author_id'] = $row['author_id'];
         $booksList[$i]['book_publish_date'] = $row['book_publish_date'];
         $booksList[$i]['genre_id'] = $row['genre_id'];
         //       $booksList[$i]['book_location'] = $row['book_location'];
         //       $booksList[$i]['book_creation'] = $row['book_creation'];
         //       $booksList[$i]['book_update'] = $row['book_update'];
         $i++;
     }
     return $booksList;
 }
開發者ID:DenisGoldiner,項目名稱:library,代碼行數:20,代碼來源:bookshelf_model.php

示例6: __construct

 public function __construct()
 {
     $this->connection = DBConnector::getConnection();
 }
開發者ID:stosdima,項目名稱:internet,代碼行數:4,代碼來源:DBModel.php


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