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