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


PHP Conn::connect方法代码示例

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


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

示例1: cadastrar_paciente

 public function cadastrar_paciente()
 {
     $conn = parent::connect();
     $result = $conn->query("INSERT INTO paciente (nome,cpf,data_nasc,telefone,endereco,nome_user,senha) VALUES ('" . $this->getNome_completo() . "','" . $this->getCpf() . "','" . $this->getData_nasc() . "','" . $this->getTelefone() . "','" . $this->getEndereco() . "','" . $this->getNome_user() . "','" . $this->getSenha() . "')");
     if ($result) {
         $m = 1;
     } else {
         $m = 0;
     }
     return $m;
 }
开发者ID:heberthoffmann,项目名称:webconsulte_dev,代码行数:11,代码来源:class.paciente.php

示例2: excluir_secretaria

 public function excluir_secretaria()
 {
     $conn = parent::connect();
     $id = $this->getId();
     $result = $conn->query("DELETE FROM secretaria WHERE cod_secretaria = {$id}");
     if ($result) {
         $result = 1;
     } else {
         $result = 0;
     }
     return $result;
 }
开发者ID:heberthoffmann,项目名称:webconsulte_dev,代码行数:12,代码来源:class.secretaria.php

示例3: Conectar

 private static function Conectar()
 {
     try {
         if (self::$connect == null) {
             $dsn = 'mysql:host=' . self::$host . ';dbname=' . self::$dbsa;
             $options = [PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES UTF8'];
             self::$connect = new PDO($dsn, self::$user, self::$pass, $options);
         }
     } catch (PDOException $e) {
         die("Erro {$e->getMessage()}");
     }
     self::$connect->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
     return self::$connect;
 }
开发者ID:brenolessa,项目名称:projeto-RI-Br,代码行数:14,代码来源:Conn.class.php

示例4: Connection

 private static function Connection()
 {
     if (self::$connect == null) {
         try {
             $dsn = 'mysql:host=' . self::$host . ';dbname=' . self::$database;
             $options = [PDO::MYSQL_ATTR_INIT_COMMAND => 'set names utf8'];
             self::$connect = new PDO($dsn, self::$user, self::$pass, $options);
         } catch (PDOException $ex) {
             die('Erro: ' . $ex->getMessage());
         }
     }
     self::$connect->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
     return self::$connect;
 }
开发者ID:Ritotsume,项目名称:schoolbus,代码行数:14,代码来源:Conn.class.php

示例5: __construct

 public function __construct()
 {
     require_once BASEPATH . DIRECTORY_SEPARATOR . APPPATH . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'database.php';
     if (!defined('HOSTNAME') || !defined('USERNAME') || !defined('PASSWORD') || !defined('DBNAME') || !defined('MYSQLPORT')) {
         foreach ($_db['userlogin'] as $key => $value) {
             $key = strtoupper($key);
             define($key, $value);
         }
         //die('Arquivo de configuração não está configurado corretamente. Configure o caminho do servidor mysql, com porta login e senha.');
     }
     $this->pdo = Conn::connect();
     $this->code = null;
     $this->elementQuery['tabela'] = '';
     $this->elementQuery['campos'] = '';
     $this->elementQuery['valores'] = '';
     $this->elementQuery['condicao'] = '';
     $this->elementQuery['orderBy'] = '';
     $this->elementQuery['limit'] = '';
     $this->elementQuery['parameters'] = array();
 }
开发者ID:Wellingtoncezar,项目名称:pfc,代码行数:20,代码来源:db.php

示例6: __construct

 public function __construct()
 {
     $this->pdo = Conn::connect();
 }
开发者ID:JessicaJAS,项目名称:pfc,代码行数:4,代码来源:db.php


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