首页 > IT职业 > IT生活 > PHP显示文章内容点击数加一
<?php
$articleid=$_GET['id'];
$conn = new mysqli("localhost", "root", "root", "xtrx.zrghs.com");
$result = $conn->query("select * from article where article_id=".$articleid);
$sql="update article set djs=djs+1 where article_id=".$articleid;
if ($result->num_rows > 0) {
// 输出数据
while($row = $result->fetch_assoc()) {
echo $row["content"];
}
} else {
echo "0 结果";
}
$conn->query($sql);
$conn->close();
?>
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/69990906/viewspace-2746413/ ,如需转载,请注明出处,否则将追究法律责任。