php mysql实现点赞功能的步骤
发布时间:2020-05-25 11:34:04
来源:PHP中文网
阅读:180
作者:三月
下面讲讲关于php mysql实现点赞功能的步骤,文字的奥妙在于贴近主题相关。所以,闲话就不谈了,我们直接看下文吧,相信看完php mysql实现点赞功能的步骤这篇文章你一定会有所受益。
php mysql怎么实现点赞功能
1、index.php 读取数据库点赞表的数量。
点赞赞
$con = mysqli_connect('localhost', 'username', 'password');
if(! $con )
{
die('连接失败: ' . mysqli_error($con));
}
mysqli_select_db($con,'jwhuang');
mysqli_query($con,"set names utf8");
$result = mysqli_query($con,"SELECT * FROM zan");
while($row = mysqli_fetch_array($result))
{
echo $row[&