本文整理汇总了PHP中pc_db_connect函数的典型用法代码示例。如果您正苦于以下问题:PHP pc_db_connect函数的具体用法?PHP pc_db_connect怎么用?PHP pc_db_connect使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了pc_db_connect函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display_section_blogs
function display_section_blogs($sec)
{
global $pcconfig;
if (!$pcconfig["SECTION"][$sec]) {
echo "对不起,目前尚无该分类。[<a href=\"javascript:history.go(-1);\">返回</a>]";
return;
}
echo "下面是<font class=f4>" . html_format($pcconfig["SECTION"][$sec]) . "</font>分类的Blog:<br /><hr size=1>";
@($pno = (int) $_GET["pno"]);
if ($pno < 1) {
$pno = 1;
}
$link = pc_db_connect();
if ($sec == "others") {
$query = "SELECT username , corpusname , description , createtime FROM users WHERE theme LIKE 'others%' OR theme = '' ORDER BY modifytime DESC LIMIT " . $pcconfig["THEMLIST"] * ($pno - 1) . "," . $pcconfig["THEMLIST"] . ";";
} else {
$query = "SELECT username , corpusname , description , createtime FROM users WHERE theme LIKE '" . addslashes($sec) . "%' ORDER BY modifytime DESC LIMIT " . $pcconfig["THEMLIST"] * ($pno - 1) . "," . $pcconfig["THEMLIST"] . ";";
}
$result = mysql_query($query, $link);
$numRows = mysql_num_rows($result);
?>
<ul style="margin-left: 20px;"><?php
for ($i = 0; $i < $numRows; $i++) {
$rows = mysql_fetch_array($result);
echo "<li><strong><a href=\"index.php?id=" . $rows["username"] . "\">" . html_format($rows["corpusname"]) . "</a></strong>[" . time_format_date1($rows["createtime"]) . "]:" . html_format($rows["description"], TRUE) . "</li>";
}
?>
</ul>
<p align=center class=f1>
<?php
if ($pno > 1) {
echo "<a href=\"pcsec.php?sec=" . $sec . "&pno=" . ($pno - 1) . "\">上一页</a>\n";
}
if ($numRows == $pcconfig["THEMLIST"]) {
echo "<a href=\"pcsec.php?sec=" . $sec . "&pno=" . ($pno + 1) . "\">下一页</a>\n";
}
pc_db_close($link);
?>
</p><?php
}
示例2: pc_db_connect
echo "[<a href='pcnew.php?pno=" . ($pno + 1) . $loadtype . "'>后" . $pcconfig["NEWS"] . "条记录</a>]\n";
} else {
echo "[后" . $pcconfig["NEWS"] . "条记录]\n";
}
?>
</p>
<?php
}
//20min更新一次
if (pc_update_cache_header()) {
return;
}
@($pno = (int) $_GET["pno"]);
$pno = $pno < 1 ? 1 : $pno;
$type = @$_GET["t"] == "c" ? "c" : "n";
$link = pc_db_connect();
if ($type == "n") {
$newBlogs = getNewBlogs($link, $pno);
$newNum = count($newBlogs["useretems"]);
} else {
$newComments = getNewComments($link, $pno);
$newNum = count($newComments);
}
pc_db_close($link);
pc_html_init("gb2312", $pcconfig["BBSNAME"] . "Blog");
?>
<br><br>
<p align=center class=f2>
欢迎使用<?php
echo $pcconfig["BBSNAME"];
?>