本文整理汇总了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'];
?>
示例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();