duan41497 2017-08-20 12:42
浏览 253
已采纳

MySQL UPDATE语句在查询中有效,但在PHP代码中无效

When I execute the statement in phpmyadmin, it works properly, but when I copy and paste the exact same query into this php file, it doesn't work.

PHP Code:

if($_GET['vote'] == 1) {
    echo "if statement ran";
    $sql = "UPDATE raids SET attendees = attendees +1 WHERE dateposted =  '2017-08-19 16:15:46'";
    mysql_query($sql, $link);
}

My link variable does work and the 'if' statement executes. Other SQL statements haven't given me trouble.

Why isn't the php code incrementing 'attendees' when used in the PHP code?

  • 写回答

1条回答 默认 最新

      报告相同问题?

      相关推荐 更多相似问题

      悬赏问题

      • ¥15 写c++代码,第7题说一下使用的计算方法
      • ¥15 有关c++的问题,利用相关知识
      • ¥15 求香农编码和解码的matlab代码
      • ¥20 ROS中的TEB局部规划问题
      • ¥20 关于#matlab#的问题:要求测出上面图片中所有同心圆的半径
      • ¥20 epanet软件运行问题
      • ¥15 Python 文件读取
      • ¥60 dpabi进行Alff计算时脑池有干扰信号
      • ¥15 利用kmeans或kshape聚类分析对归一化的无量纲时间-降雨序列进行聚类
      • ¥15 protel99.SE提示一下弹窗