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


PHP Conn类代码示例

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


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

示例1: giveAuthor

 public static function giveAuthor($id)
 {
     $db = new Conn();
     if ($id == '0') {
         return 'Anonymous';
     } else {
         $author = mysql_fetch_array($db->db_query("SELECT username FROM members WHERE id='{$id}'"));
         return $author['username'];
     }
 }
开发者ID:Chocksy,项目名称:opiniodev-feedback-forum,代码行数:10,代码来源:render.class.php

示例2: findAll

 /**
  * <b>Não é passado com os Joins</b>
  * 
  * @return array[Objetos]
  */
 public function findAll()
 {
     $sql = "SELECT * FROM {$this->Table}";
     $this->Stmt = Conn::prepare($sql);
     $this->Stmt->execute();
     return $this->Stmt->fetchAll();
 }
开发者ID:adrianosilvareis,项目名称:FrameWork_Front,代码行数:12,代码来源:Business.class.php

示例3: Connect

 private function Connect()
 {
     // obteve a conexão
     $this->conn = parent::getConn();
     //cria a query
     $this->create = $this->conn->prepare($this->create);
 }
开发者ID:brenolessa,项目名称:projeto-RI-Br,代码行数:7,代码来源:Create.class.php

示例4: Connect

 /**
  * ****************************************
  * *********** PRIVATE METHODS ************
  * ****************************************
  */
 private function Connect()
 {
     $this->Conn = parent::getConn();
     $this->Read = $this->Conn->prepare($this->Select);
     // Retornar resultados em arrays
     $this->Read->setFetchMode(PDO::FETCH_ASSOC);
 }
开发者ID:BrunoDuarte,项目名称:WS_PHP_ADMIN,代码行数:12,代码来源:Read.class.php

示例5: updateAccount

 /**
  * @param $Account ClientAccount
  */
 public static function updateAccount($Account)
 {
     include_once $_SERVER['DOCUMENT_ROOT'] . "/bossflex/DB/Conn.php";
     $sql = "UPDATE ClientAccount SET Balance = ? WHERE AccountNum = ?";
     $stmt = Conn::get()->prepare($sql);
     $stmt->execute(array($Account->getBalance(), $Account->getAccountNum()));
 }
开发者ID:elmo911,项目名称:WolfeSolutions,代码行数:10,代码来源:ClientAccount.php

示例6: addDependent

 /**
  * @param $employee Employee
  * @param $dependent Dependent
  */
 public static function addDependent($employee, $dependent)
 {
     include_once $_SERVER['DOCUMENT_ROOT'] . "/bossflex/DB/Conn.php";
     $sql = "INSERT INTO Dependents (EID, CID, Fname, Lname, Relation, Birthday) VALUES (?, ?, ?, ?, ?, ?)";
     $stmt = Conn::get()->prepare($sql);
     $stmt->execute(array($employee->getEID(), $employee->getCID(), $dependent->getFname(), $dependent->getLname(), $dependent->getRelation(), $dependent->Birthday));
 }
开发者ID:elmo911,项目名称:WolfeSolutions,代码行数:11,代码来源:Dependent.php

示例7: Connect

 /**
  * PRIVATE METODOS
  */
 private function Connect()
 {
     /** Pega a Conexão com a Class Pai Conn e atribui ao $this->Conn */
     $this->Conn = parent::getConn();
     /** Cria o Prepare Statement do Select */
     $this->Update = $this->Conn->prepare($this->Update);
 }
开发者ID:hsnunes,项目名称:drmeatende,代码行数:10,代码来源:Update.class.php

示例8: Connect

 /**
  * PRIVATE METODOS
  */
 private function Connect()
 {
     /** Pega a Conexão com a Class Pai Conn e atribui ao $this->Conn */
     $this->Conn = parent::getConn();
     /** Cria o Prepare Statement do Select */
     $this->Read = $this->Conn->prepare($this->Select);
     /** Seta o retorno dos dados no Formato fetch_assoc */
     $this->Read->setFetchMode(PDO::FETCH_ASSOC);
 }
开发者ID:hsnunes,项目名称:drmeatende,代码行数:12,代码来源:Read.class.php

示例9: getRoleList

 public static function getRoleList()
 {
     include_once "../../bossflex/DB/Conn.php";
     $sql = "SELECT RoleID, Role\n                FROM UserRole\n                ORDER BY RoleID DESC \n                LIMIT 0 , 30";
     $stmt = Conn::get()->query($sql, PDO::FETCH_ASSOC);
     $roleList = array();
     while ($role = $stmt->fetchObject(__CLASS__)) {
         $roleList[] = $role;
     }
     return $roleList;
 }
开发者ID:elmo911,项目名称:WolfeSolutions,代码行数:11,代码来源:UserRole.php

示例10: getCodeList

 public static function getCodeList()
 {
     include_once "../../bossflex/DB/Conn.php";
     $sql = "SELECT Code, Reason\n                FROM DisableCode";
     $stmt = Conn::get()->query($sql, PDO::FETCH_ASSOC);
     $codeList = array();
     while ($code = $stmt->fetchObject(__CLASS__)) {
         $codeList[] = $code;
     }
     return $codeList;
 }
开发者ID:elmo911,项目名称:WolfeSolutions,代码行数:11,代码来源:DisableCode.php

示例11: getReport

 public static function getReport()
 {
     include_once $_SERVER['DOCUMENT_ROOT'] . "/bossflex/DB/Conn.php";
     $conn = Conn::get();
     $sql = "SELECT * FROM Exception ORDER BY TimeStamp DESC";
     try {
         return $conn->query($sql);
     } catch (Exception $e) {
         return null;
     }
 }
开发者ID:elmo911,项目名称:WolfeSolutions,代码行数:11,代码来源:ErrorReport.php

示例12: BackupDatabase

 public function BackupDatabase($database)
 {
     $connection = parent::getConnection();
     // try{
     //     $backup = $connection->prepare('mysqldump -u root -p 123456 '. $database .' > ' . HOME . 'archives/backup.sql');
     //     $backup->execute();
     //     return true;
     // }catch(Exception $e){
     //     return false;
     //     $this->result = $e;
     // }
     return system('mysqldump -u root -p 123456 ' . $database . ' > ' . HOME . 'archives/backup.sql');
 }
开发者ID:Ritotsume,项目名称:schoolbus,代码行数:13,代码来源:ModelAdmin.class.php

示例13: PDO

 /**
  * 数据库连接
  */
 public static function &getConn()
 {
     if (self::$conn == null) {
         $conn = new PDO(sprintf(Config::DB_LINK, DIR_ROOT), "charset=UTF-8");
         if (IS_DEBUG) {
             $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
         } else {
             $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_SILENT);
         }
         self::$conn = $conn;
     }
     return self::$conn;
 }
开发者ID:BGCX261,项目名称:zoeeyphp-hg-to-git,代码行数:16,代码来源:Conn.php

示例14: depositAmt

 public static function depositAmt($AccountNum, $DepositedByUID, $Amount, $PayRollDate)
 {
     include_once $_SERVER['DOCUMENT_ROOT'] . "/bossflex/DB/Conn.php";
     $db = Conn::get();
     $sql = "INSERT INTO Deposit (AccountNum, DepositedByUID, Amount, PayRollDate) VALUES (?, ?, ?, ?)";
     $stmt = $db->prepare($sql);
     $stmt->execute(array($AccountNum, $DepositedByUID, $Amount, $PayRollDate));
     $depID = $db->lastInsertId();
     $sql = "SELECT * FROM Deposit WHERE DepositID = :id";
     $stmt = Conn::get()->prepare($sql);
     $stmt->bindParam(":id", $depID, PDO::PARAM_INT);
     $stmt->execute();
     return $stmt->fetchObject(__CLASS__);
 }
开发者ID:elmo911,项目名称:WolfeSolutions,代码行数:14,代码来源:Deposit.php

示例15: getInstance

 public static function getInstance()
 {
     if (is_null(self::$instance)) {
         self::$instance = new self();
     }
     return self::$instance;
 }
开发者ID:grzesieksocha,项目名称:myTweet,代码行数:7,代码来源:class.DbConnect.inc.php


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