dongzhunqiu4841 2014-11-12 15:49
浏览 27
已采纳

页面视图计数器计数添加2而不是1

This code iv written is working as i like, but for some reason when refreshing the page counter adds 2 instead of 1, the Views column is as an Integer.

$updateviews = $db->prepare("UPDATE pages SET views = views + 1 WHERE type = 'home'");
$updateviews->execute();

Hope someone can help, cant seam to find the problem.

  • 写回答

1条回答 默认 最新

  • doushan6161 2014-11-20 14:35
    关注

    Iv fixed it, im not sure what iv done but just playing with code over time and i checked it again today and now it works.. strange.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 双层网络上信息-疾病传播
  • ¥50 paddlepaddle pinn
  • ¥15 Stata 面板数据模型选择
  • ¥20 idea运行测试代码报错问题
  • ¥15 网络监控:网络故障告警通知
  • ¥15 django项目运行报编码错误
  • ¥15 请问这个是什么意思?
  • ¥15 STM32驱动继电器
  • ¥15 Windows server update services
  • ¥15 关于#c语言#的问题:我现在在做一个墨水屏设计,2.9英寸的小屏怎么换4.2英寸大屏