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


PHP Conn::getConn方法代碼示例

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


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

示例1: 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

示例2: 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

示例3: 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

示例4: 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

示例5: smarty_function_newsView

/**
 * 單信息顯示
 * @param type $params
 * @param Tpl $tpl
 * @return type
 */
function smarty_function_newsView($params, &$tpl)
{
    $values = array();
    $types = array();
    /* @var $acStr ZeActiveString */
    $acStr = new ZeActiveString();
    $acStr->putAll(array('select' => 'SELECT
                         `id`,`title`,`category`
                          ,`detail`,`create_time`,`edit_time`
                FROM `news_e` news
                WHERE 1=1
         ', 'where.id' => 'AND `id` = :id ', 'where.next' => 'AND `id` > :id ', 'where.category' => 'AND `category` = :category ', 'where.category.set' => 'AND FIND_IN_SET(`category`,:category) > 0 ', 'where.search' => 'AND (`title` LIKE "%" || :search || "%"
                                 OR `detail` LIKE "%" || :search || "%") ', 'limit' => 'LIMIT 1 '));
    $acStr->active('select');
    $acStr->active('limit');
    $id = $tpl->getArg($params, 'id', null);
    if (is_numeric($id) && $id > 0) {
        $values['id'] = intval($id);
        $types['id'] = PDO::PARAM_INT;
        $acStr->active('where.id');
    }
    $next = $tpl->getArg($params, 'next', null);
    if (is_numeric($next) && $next > 0) {
        $values['id'] = intval($next);
        $types['id'] = PDO::PARAM_INT;
        $acStr->active('where.next');
    }
    /* todo prev */
    /* @var $recorder ZeRecorder */
    $recorder = new ZeRecorder(Conn::getConn());
    /* @var $pageSet ZePageSet */
    $pageSet = $tpl->getPageSet($params);
    $as = $tpl->getArg($params, 'as', 'news');
    $sql = $acStr->toString();
    $row = $recorder->query($sql)->bind($values, $types)->fetch();
    $tpl->assign($as, $row);
}
開發者ID:BGCX261,項目名稱:zoeeyphp-hg-to-git,代碼行數:43,代碼來源:function.newsView.php

示例6: view

 /**
  *
  * @global UserInfo $userInfo
  * @param array $fields
  * @return array
  */
 public static function view($fields)
 {
     $info = null;
     do {
         $values = array();
         $types = array();
         $sql = 'SELECT
                       `id`,`title`,`category`
                       ,`detail`,`create_time`,`edit_time`
                FROM `news_e`
                WHERE `id` = :id
               ';
         $values['id'] = $fields['id'];
         $types['id'] = PDO::PARAM_INT;
         $recorder = new ZeRecorder(Conn::getConn());
         $info = $recorder->query($sql)->bind($values)->fetch();
     } while (false);
     return $info;
 }
開發者ID:BGCX261,項目名稱:zoeeyphp-hg-to-git,代碼行數:25,代碼來源:NewsRecorder.php

示例7: Connect

 private function Connect()
 {
     $this->Conn = parent::getConn();
     $this->Read = $this->Conn->prepare($this->Select);
     $this->Read->setFetchMode(PDO::FETCH_ASSOC);
 }
開發者ID:jairophp,項目名稱:amarmais,代碼行數:6,代碼來源:Read.php

示例8: Connect

 private function Connect()
 {
     $this->Conn = parent::getConn();
     $this->Update = $this->Conn->prepare($this->Update);
 }
開發者ID:jairophp,項目名稱:amarmais,代碼行數:5,代碼來源:Update.php

示例9: connect

 private function connect()
 {
     $this->conn = parent::getConn();
     $this->create = $this->conn->prepare($this->create);
 }
開發者ID:GDantas05,項目名稱:WorkSeries,代碼行數:5,代碼來源:Create.class.php

示例10: Conn

<!DOCTYPE html>
<html lang="pt-br">
  <head>
    <meta charset="utf-8">
    <title></title>
  </head>
  <body>
    <?php 
require './_app/Config.inc.php';
$PDO = new Conn();
$name = 'Chrome';
$views = '250';
try {
    $qRCreate = "INSERT INTO ws_siteviews_agent (agent_name, agent_views) VALUES (?, ?)";
    $create = $PDO->getConn()->prepare($qRCreate);
    $create->bindParam(1, $name, PDO::PARAM_STR, 15);
    $create->bindParam(2, $views, PDO::PARAM_INT, 5);
    $create->execute();
    if ($create->rowCount()) {
        echo "{$PDO->getConn()->lastInsertId()} - Cadastrado com sucesso <hr>";
    }
    $qRSelect = "SELECT * FROM ws_siteviews_agent WHERE agent_views >= :visitas";
    $select = $PDO->getConn()->prepare($qRSelect);
    $select->bindValue(':visitas', '7');
    $select->execute();
    if ($select->rowCount() >= 1) {
        echo "Pesquisa retornou {$select->rowCount()} resultado(s) <hr>";
        $resultado = $select->fetchAll(PDO::FETCH_ASSOC);
        var_dump($resultado);
    } else {
        echo "Nenhum resultado encontrado <hr>";
開發者ID:GDantas05,項目名稱:WorkSeries,代碼行數:31,代碼來源:02-prepared-statements.php

示例11: __construct

 /**
  * __construct
  * Inicializa a conexao e o nome da tabela
  * 
  * @param string $table nome da tabela
  */
 public function __construct($table)
 {
     $this->conn = parent::getConn();
     $this->table = $table;
 }
開發者ID:Giselly,項目名稱:GPDev,代碼行數:11,代碼來源:Crud.class.php

示例12: Conn

<!DOCTYPE html>
<html lang="pt-br">
  <head>
    <meta charset="utf-8">
    <title></title>
  </head>
  <body>
    <?php 
require './_app/Config.inc.php';
$conn = new Conn();
$conn->getConn();
var_dump($conn->getConn());
?>
  </body>
</html>
開發者ID:GDantas05,項目名稱:WorkSeries,代碼行數:15,代碼來源:01-conectando-ao-banco.php

示例13: Conn

<!DOCTYPE html>
<html lang="pt-br">
    <head>
        <meta charset="UTF-8">
        <title></title>
    </head>
    <body>
        <?php 
require './_app/Config.inc.php';
$Conn = new Conn();
try {
    $Query = "Select * from ws_siteviews_agent where agent_name = :name";
    $Exec = $Conn->getConn()->prepare($Query);
    $Exec->bindValue(":name", 'Chrome');
    $Exec->execute();
    $Chrome = $Exec->fetchAll(PDO::FETCH_ASSOC);
    // ou apenas fetch se retornar apenas um resultado
    $Exec->bindValue(":name", 'Safari');
    $Exec->execute();
    $Safari = $Exec->fetch(PDO::FETCH_ASSOC);
} catch (PDOException $e) {
    PHPErro($e->getCode(), $e->getMessage(), $e->getFile(), $e->getLine());
}
if ($Chrome) {
    //            var_dump($Chrome);
    echo "{$Chrome[0]['agent_name']} tem {$Chrome[0]['agent_views']} visita(s)<hr>";
}
if ($Safari) {
    //            var_dump($Safari);
    echo "{$Safari['agent_name']} tem {$Safari['agent_views']} visita(s)<hr>";
}
開發者ID:BrunoDuarte,項目名稱:WS_PHP_ADMIN,代碼行數:31,代碼來源:03-stered-procedures.php

示例14: Connect

 /**
  * ****************************************
  * *********** PRIVATE METHODS ************
  * ****************************************
  */
 private function Connect()
 {
     $this->Conn = parent::getConn();
     $this->Update = $this->Conn->prepare($this->Update);
     $this->Update->setFetchMode(PDO::FETCH_ASSOC);
 }
開發者ID:arthurleon,項目名稱:ytradio,代碼行數:11,代碼來源:Update.class.php

示例15: Conn

<!DOCTYPE html>
<html lang="pt-br">
  <head>
    <meta charset="utf-8">
    <title></title>
  </head>
  <body>
    <?php 
require './_app/Config.inc.php';
$conn = new Conn();
try {
    $query = "SELECT * FROM ws_siteviews_agent WHERE agent_name = :name";
    $exe = $conn->getConn()->prepare($query);
    $exe->bindValue(":name", 'Chrome');
    $exe->execute();
    $chrome = $exe->fetch(PDO::FETCH_ASSOC);
    $exe->bindValue(":name", 'Firefox');
    $exe->execute();
    $firefox = $exe->fetch(PDO::FETCH_ASSOC);
} catch (PDOException $e) {
    PHPErro($e->getCode(), $e->getMessage(), $e->getFile(), $e->getLine());
}
if ($chrome) {
    //var_dump($chrome);
    echo "{$chrome['agent_name']} tem {$chrome['agent_views']} visita(s) <hr>";
}
if ($firefox) {
    //var_dump($firefox);
    echo "{$firefox['agent_name']} tem {$firefox['agent_views']} visita(s) <hr>";
}
?>
開發者ID:GDantas05,項目名稱:WorkSeries,代碼行數:31,代碼來源:03-stored-procedures.php


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