當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。