简体   繁体   English

PHP Mysql-MySQL_Query命令未运行

[英]PHP Mysql - MySQL_Query command not running

Not sure why, but this line does not even give an error, it simply does not run, and also stops any code after it running. 不知道为什么,但是该行甚至没有给出错误,它只是不运行,并且在运行后也停止了任何代码。 I have checked with die("check") either side of the statement, and only runs before. 我已经在语句的任何一侧使用die(“ check”)进行了检查,并且仅在之前运行。

mysql_query("UPDATE rounds 
             SET `active`='0', `winnerusername`='$WinnerUsername', `winnerid`='$WinnerID', `pot`='$PreviousPot', `paid`='1' 
             WHERE `round`='$CurrentRound' ") or die(mysql_error());

Any idea why it will not run? 知道为什么它将无法运行吗?

Change it as 更改为

mysql_query(
  "UPDATE rounds SET `active`='0',
       `winnerusername`='".$WinnerUsername."', 
       `winnerid`='".$WinnerID."', 
       `pot`='".$PreviousPot."', 
       `paid`='1' 
   WHERE `round`='".$CurrentRound."' "
) or die(mysql_error());

try this: 尝试这个:

$sql="UPDATE rounds SET active='0', winnerusername='".$WinnerUsername."', winnerid='".$WinnerID."', pot='".$PreviousPot."', paid='1' WHERE round='".$CurrentRound."' ";
$rs=mysql_query($sql,$Your_Connection_String);

with $Your_Connection_String being something like: $Your_Connection_String类似于:

$Your_Connection_String=mysql_connect("localhost","username","password");
mysql_select_db("db_name",$Your_Connection_String);

try to echo $sql; 尝试echo $sql; below the query and then paste this into a query in PHPMyAdmin or a MySQL Connection program and see what output you get 在查询下方,然后将其粘贴到PHPMyAdmin或MySQL Connection程序中的查询中,查看获得的输出

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM