PHP Mysql-Mysql\u查询命令未运行
不知道为什么,但这一行甚至没有给出错误,它只是不运行,并且在运行后停止任何代码。我已经用die(“check”)检查了语句的任意一侧,并且只在之前运行过PHP Mysql-Mysql\u查询命令未运行,php,mysql,Php,Mysql,不知道为什么,但这一行甚至没有给出错误,它只是不运行,并且在运行后停止任何代码。我已经用die(“check”)检查了语句的任意一侧,并且只在之前运行过 mysql_query("UPDATE rounds SET `active`='0', `winnerusername`='$WinnerUsername', `winnerid`='$WinnerID', `pot`='$PreviousPot', `paid`='1' WHERE `
mysql_query("UPDATE rounds
SET `active`='0', `winnerusername`='$WinnerUsername', `winnerid`='$WinnerID', `pot`='$PreviousPot', `paid`='1'
WHERE `round`='$CurrentRound' ") or die(mysql_error());
知道它为什么不运行吗?将其更改为
mysql_query(
"UPDATE rounds SET `active`='0',
`winnerusername`='".$WinnerUsername."',
`winnerid`='".$WinnerID."',
`pot`='".$PreviousPot."',
`paid`='1'
WHERE `round`='".$CurrentRound."' "
) or die(mysql_error());
试试这个:
$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\u Connection\u String
类似于:
$Your_Connection_String=mysql_connect("localhost","username","password");
mysql_select_db("db_name",$Your_Connection_String);
尝试
echo$sql在查询下方编写>代码,然后将其粘贴到PHPMyAdmin或MySQL连接程序中的查询中,然后查看您得到的输出在?1中替换所有变量后,SQL语句是什么样子的。没有要更新的行。2.关于准备好的语句:也不要使用backticks`当你真的不需要的时候。mysql.*
函数不再维护,不应该在任何新的代码库中使用。它正逐渐被淘汰,取而代之的是更新的API。相反,您应该与或一起使用。@user2924019请尝试使用此选项:)