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