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


PHP Mysql::close方法代码示例

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


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

示例1: isset

<!DOCTYPE html>
<?php 
require_once '../inc/mysql.inc.php';
require_once '../inc/soup.inc.php';
require_once '../inc/utils.inc.php';
$num = isset($_GET['num']) ? strip_tags(mysql_escape_string($_GET['num'])) : 1;
$SoupDao = new SoupDao();
$soup = $SoupDao->findById($num);
if ($soup == null) {
    echo "<script>location.href='http://soup.setin.cn/';</script>";
    exit;
}
$nextid = $SoupDao->searchNextArticleID($num);
$preid = $SoupDao->searchPreArticleID($num);
Mysql::close();
$title = substr_ext($soup['content'], 0, 30);
$title = preg_replace("/\\s/", "", $title);
$descrip = substr_ext($soup['content'], 0, 100);
$descrip = preg_replace("/\\s/", "", $descrip);
?>
<html lang="zh-CN">
    <head>
        <meta charset="UTF-8" />
        <meta name="renderer" content="webkit" />
        <meta http-equiv="Cache-Control" content="no-siteapp" />
        <meta http-equiv="Cache-Control" content="no-transform " /> 
        <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <meta name="keywords" content="心灵鸡汤,<?php 
echo $soup['j_tag'];
?>
开发者ID:ircoco,项目名称:setin.cn,代码行数:31,代码来源:article.php

示例2: Mysql

foreach ($KeyList as $k => $v) {
    if (!isset($_GET[$v])) {
        $res = ['ok' => 0, 'error' => "param invalid "];
        echo json_encode($res);
        die;
    }
}
$mysql = new Mysql();
$result = $mysql->select("*", "footprint", "`footId`", "'{$_GET['footprintId']}'");
if ($result) {
    if ($result['userId'] == $_GET['userId']) {
        $myMemcache = new MyMemcache();
        $footprintId = $result['id'];
        $removeFootprint = "delete from footprint where id={$footprintId}";
        //echo $removeFootprint;
        $mysql->query($removeFootprint);
        $myMemcache->delete($_GET['userId'] . "foot" . $result['footId']);
        if ($myMemcache->get("like" . $result['footId']) && $myMemcache->get("like" . $result['footId']) == 1) {
            //$removeFoot="delete from foot where id={$result['footId']}";
            //$mysql->query($removeFoot);
        }
        echo json_encode(['ok' => 1]);
    } else {
        echo json_encode(['ok' => 0, 'error' => "no permission"]);
        die;
    }
} else {
    echo json_encode([ok => 0, error => "footId not exsit"]);
}
$mysql->close();
开发者ID:shaoshao613,项目名称:footprint,代码行数:30,代码来源:remove.php


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