簡體   English   中英

PHP Mysql-MySQL_Query命令未運行

[英]PHP Mysql - MySQL_Query command not running

不知道為什么,但是該行甚至沒有給出錯誤,它只是不運行,並且在運行后也停止了任何代碼。 我已經在語句的任何一側使用die(“ check”)進行了檢查,並且僅在之前運行。

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_Connection_String類似於:

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

嘗試echo $sql; 在查詢下方,然后將其粘貼到PHPMyAdmin或MySQL Connection程序中的查詢中,查看獲得的輸出

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM