0

不知道为什么,但是这一行甚至没有给出错误,它根本没有运行,并且在运行后也会停止任何代码。我已经用 die("check") 检查了语句的任何一侧,并且只在之前运行过。

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

知道为什么它不会运行吗?

4

2 回答 2

0

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());
于 2013-10-31T20:15:08.800 回答
0

尝试这个:

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

类似于$Your_Connection_String

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

尝试echo $sql;在查询下方,然后将其粘贴到 PHPMyAdmin 或 MySQL 连接程序中的查询中,看看你得到什么输出

于 2013-10-31T20:18:56.093 回答