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


PHP DataBase::createConection方法代码示例

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


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

示例1: buscaTodosProgramas

 public function buscaTodosProgramas()
 {
     DataBase::createConection();
     $res = mysql_query($this->_sel);
     if ($res === FALSE) {
         echo "programa desconhecido: " . $this->_sel;
         return null;
     } else {
         return $res;
     }
 }
开发者ID:laiello,项目名称:acao-moradia,代码行数:11,代码来源:ProgramaDAO.php

示例2: cadastraFamilia

<?php

include_once 'DBConnection.php';
DataBase::createConection();
class FamiliaDAO
{
    private $_ins = "INSERT INTO familia (`cep`, `logradouro`, `numero`, `bairro`, `cod_cidade`) VALUES";
    private $_rem = "DELETE FROM familia WHERE";
    private $_alt = "UPDATE familia set";
    private $_sel = "SELECT * FROM familia";
    private $_sel_max_id = "SELECT max(id_familia) as max_id_familia FROM familia";
    public function cadastraFamilia($cep, $logradouro, $numero, $bairro, $cod_cidade)
    {
        $this->_ins .= " ('{$cep}', '{$logradouro}', {$numero}, '{$bairro}', '{$cod_cidade}')";
        $_res = mysql_query($this->_ins) or mysql_errno();
        if ($_res != TRUE) {
            echo 'falha na operação';
        }
        return $_res;
    }
    public function removeFamiliaById($idFamilia)
    {
        $this->_rem .= " id_familia={$idFamilia}";
        return mysql_query($this->_rem) or die(mysql_error());
        //this.testeInsert($_res);
    }
    public function buscaFamiliaById($idFamilia)
    {
        $select = "SELECT * FROM familia WHERE id_familia= {$idFamilia}";
        $res = mysql_query($select);
        if ($res === FALSE) {
开发者ID:laiello,项目名称:acao-moradia,代码行数:31,代码来源:FamiliaDAO.php


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