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


PHP disconnect函数代码示例

本文整理汇总了PHP中disconnect函数的典型用法代码示例。如果您正苦于以下问题:PHP disconnect函数的具体用法?PHP disconnect怎么用?PHP disconnect使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: actionScrollview

 public function actionScrollview($text = "")
 {
     if ($text == "") {
         $query = "SELECT article_modulecomponentid FROM scrolltext WHERE page_modulecomponentid=" . $this->moduleComponentId;
         $result = mysql_query($query);
         $row = mysql_fetch_assoc($result);
         $articleid = $row['article_modulecomponentid'];
         $query = "SELECT article_content,article_lastupdated FROM article_content WHERE page_modulecomponentid=" . $articleid;
         $result = mysql_query($query);
         if ($row = mysql_fetch_assoc($result)) {
             $text = $row['article_content'];
             global $PAGELASTUPDATED;
             $PAGELASTUPDATED = $row['article_lastupdated'];
         } else {
             return "Article not yet created.";
         }
     }
     $content = "<HEAD><META HTTP-EQUIV=REFRESH CONTENT=300></HEAD><body><div><div align=\"center\"><fieldset><marquee behavior=scroll scrollAmount=\"1\" scrolldelay=\"0\" onmouseover=\"this.stop()\" direction=\"up\" onmouseout=\"this.start()\" vspce=\"800px\"style=\"height:800px;width:800px;font-size:15px;color:#880000;\">" . $text . "</div></fieldset></marquee></body>";
     global $sourceFolder;
     global $moduleFolder;
     require_once $sourceFolder . "/pngRender.class.php";
     if (get_magic_quotes_gpc()) {
         $content = stripslashes($content);
     }
     $render = new pngrender();
     echo $render->transform($content);
     disconnect();
     exit;
 }
开发者ID:ksb1712,项目名称:pragyan,代码行数:29,代码来源:scrolltext.lib.php

示例2: fetchAllorders

function fetchAllorders()
{
    $con = connect();
    $result = mysqli_query($con, "SELECT * from orders");
    disconnect($con);
    return $result;
}
开发者ID:parbatthakur,项目名称:web-programming,代码行数:7,代码来源:functions.php

示例3: error

function error($msg)
{
    global $title, $header;
    html($title, $header, "<h2>Erro</h2>{$msg}");
    disconnect();
    exit(1);
}
开发者ID:mohamedbiniz,项目名称:qualityranking,代码行数:7,代码来源:ireval.php

示例4: fetchWithQuery

function fetchWithQuery($query)
{
    $con = connect();
    $result = mysqli_query($con, $query);
    disconnect($con);
    return $result;
}
开发者ID:parbatthakur,项目名称:web-programming-2,代码行数:7,代码来源:functions.php

示例5: testConnect

 public function testConnect()
 {
     global $connection_string;
     $this->assertTrue(isset($connection_string), "connection string should be set");
     $dbconnection = connect();
     $this->assertTrue(isset($dbconnection), "DB Connection should be set");
     disconnect($dbconnection);
 }
开发者ID:ahiliation,项目名称:beautifulwork,代码行数:8,代码来源:DBTest.php

示例6: numberOfRespondents

/** Prints the number of people that have responded to the poll */
function numberOfRespondents()
{
    connect();
    $q = "SELECT * FROM " . RESULTS_TABLE;
    $result = mysql_query($q) or mysql_err($q);
    print mysql_num_rows($result);
    disconnect();
}
开发者ID:ralphleon,项目名称:Pollinator,代码行数:9,代码来源:admin_helper.php

示例7: reg

 public function reg()
 {
     $state = $this->in_get('state', None, 2, 'True');
     $wx_data = base64_decode($state);
     $code = $this->in_get('code', None, 2, 'True');
     $wx_data_arr = explode('@@', $wx_data);
     $schId = intval($wx_data_arr[0]);
     $room = in($wx_data_arr[1]);
     $phone = in($wx_data_arr[2]);
     $msg = Check::rule(array(check::mobile($phone), '手机电话号码格式不对'));
     if ($msg != 1) {
         $this->alert('您的手机号码不正确');
     }
     $r = connectRedis($this->config['RD_HOST'], $this->config['RD_PORT'], $this->config['RD_PWD']);
     $apiUser = new api_userMod();
     $wx_res = $apiUser->get_info_user_weixin($code, $r);
     if (!$wx_res) {
         $this->alert('请用微信登陆');
     }
     $check_con['openid'] = $wx_res['openid'];
     $field = 'p_id';
     $check_res = $this->model->table($this->config['info_person'])->field($field)->where($check_con)->find();
     if ($check_res) {
         // 如果此微信号已经存在,直接登陆
         $apiUser->set_login_mark($check_res['p_id'], $code, $r);
         disconnect($r);
         $this->redirect(__ROOT__ . '/order/water');
     } else {
         // 否则插入数据
         $data['s_id'] = $schId;
         $res = $this->model->table($this->config['school'])->where($data)->find();
         if ($res) {
             $data['name'] = $wx_res['nickname'];
             $data['addr'] = $room;
             $data['phone'] = $phone;
             $data['openid'] = $wx_res['openid'];
             $data['pic'] = $wx_res['headimgurl'];
             $data['s_name'] = $res['name'];
             $data['sex'] = $wx_res['sex'];
             $data['city'] = $wx_res['city'];
             $data['province'] = $wx_res['province'];
             $data['point'] = 100;
             $res = $this->model->table($this->config['info_person'])->data($data)->insert();
             if ($res) {
                 $apiUser->set_login_mark($res, $code, $r);
                 disconnect($r);
                 setcookie('susCode', time(), time() + EX_TIME_COOKIE, __ROOT__);
                 $this->redirect(__URL__ . '/suss');
             } else {
                 disconnect($r);
                 $this->alert('对不起,网络暂时出了点小问题');
             }
         } else {
             disconnect($r);
             $this->alert('对不起,贵校暂时没有开通此服务');
         }
     }
 }
开发者ID:heYeCheng,项目名称:dingling,代码行数:58,代码来源:registerMod.class.php

示例8: get_notes

function get_notes($user_id)
{
    $mysql_link = connect();
    $query = sprintf("SELECT * FROM note WHERE user_id='%s'", mysql_real_escape_string($user_id, $mysql_link));
    $result = mysql_query($query, $mysql_link);
    $notes = fetch_all($result);
    disconnect($mysql_link);
    return $notes;
}
开发者ID:romaimperator,项目名称:trustauth-demo,代码行数:9,代码来源:mysql.php

示例9: execute_update

function execute_update($sql)
{
    $db = connect();
    $res = mysql_query($sql, $db);
    if (!$res) {
        trigger_error("Error executing update :" . mysql_error());
        die;
    }
    disconnect($db);
}
开发者ID:ahiliation,项目名称:beautifulwork,代码行数:10,代码来源:dvd-db_mysql.php

示例10: execute_update

function execute_update($sql)
{
    $db = connect();
    $res = pg_query($db, $sql);
    if (!$res) {
        trigger_error("Error executing update :" . pg_last_error($res));
        die;
    }
    disconnect($db);
}
开发者ID:ahiliation,项目名称:beautifulwork,代码行数:10,代码来源:dvd-db_pgsql.php

示例11: execute_insert

function execute_insert($email, $pass, $FirstName, $LastName)
{
    $con = connect();
    $sql = " INSERT INTO info (\n\t\t\t\t\t\t\t\t`Email`,\n\t\t\t\t\t\t\t\t`Pass`,\n\t\t\t\t\t\t\t\t`First`,\n\t\t\t\t\t\t\t\t`Last`)\n\t\t\t\t\t\tVALUES(\n\t\t\t\t\t\t\t\t'" . $email . "',\n\t\t\t\t\t\t\t\t'" . md5($pass) . "',\n\t\t\t\t\t\t\t\t'" . $FirstName . "',\n\t\t\t\t\t\t\t\t'" . $LastName . "'\n\t\t\t\t\t\t\t\t)";
    if (!mysql_query($sql, $con)) {
        header("location:form.php?err=Email is already in used");
    } else {
        disconnect($con);
        return true;
    }
}
开发者ID:ravedien,项目名称:folder1,代码行数:11,代码来源:functions.php

示例12: Remove_SQLi

function Remove_SQLi($str)
{
    $con = connect();
    if (get_magic_quotes_gpc()) {
        $retStr = mysql_real_escape_string(stripslashes($str));
    } else {
        $retStr = mysql_real_escape_string($str);
    }
    disconnect($con);
    return $retStr;
}
开发者ID:santosh84das,项目名称:DCPS-Recruitment,代码行数:11,代码来源:connection.php

示例13: connect

function connect()
{
    // Connects to mySQL database
    if ($GLOBALS['db']['connected']) {
        disconnect();
    }
    $GLOBALS['db']['conn'] = new mysqli($GLOBALS['db']['server'], $GLOBALS['db']['user'], $GLOBALS['db']['pass'], $GLOBALS['db']['database']);
    if ($GLOBALS['db']['conn']->connect_error) {
        die("Connection failed: " . $GLOBALS['db']['conn']->connect_error);
    }
    $GLOBALS['db']['connected'] = true;
}
开发者ID:armsnyder,项目名称:bonehead-site,代码行数:12,代码来源:util.php

示例14: executeQueryId

 function executeQueryId($query)
 {
     $this->connect();
     $this->query = $query;
     if ($this->result = mysql_query($this->query)) {
         return $this->result;
     } else {
         echo "Ocorreu um erro na execu��o da SQL<BR>";
         echo "Erro :" . mysql_error() . "<BR>";
         echo "SQL: " . $query . "<BR>";
         die;
         disconnect();
     }
 }
开发者ID:victornqs,项目名称:php-tools,代码行数:14,代码来源:MySQL.class.php

示例15: executeQuery

 function executeQuery($query)
 {
     $this->connect();
     $this->query = $query;
     if ($this->result = mysql_query($this->query)) {
         $this->disconnect();
         return $this->result;
     } else {
         echo "<b>Ocorreu um erro</b><br>";
         echo "Erro: " . mysql_error();
         die;
         disconnect();
     }
 }
开发者ID:WesleyM2510,项目名称:WEB,代码行数:14,代码来源:conexao+F.php


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