我试图理解准备好的陈述,并为此做出准备好的陈述:
// UPDATE GAME PLAYERS DATA IN DB //
mysql_query("UPDATE ".$prefix."_gameplayer SET player_tiles='$playertiles'
, player_draws='$udraws'
, player_turn=0
, last_draw_type=1
WHERE fk_player_id=$playerid AND fk_game_id=$currgame");
// UPDATE GAME OPPONENTS DATA IN DB //
mysql_query("UPDATE ".$prefix."_gameplayer SET player_turn=1
, last_draw_type=2
WHERE fk_player_id=$opponent AND fk_game_id=$currgame");
我正在考虑这样做,但正在徘徊如何确保不更新第二条语句中的某些字段:
$stmt->prepare("UPDATE ".$prefix."_gameplayer SET player_tiles='?'
, player_draws=?
, player_turn=?
, last_draw_type=?
WHERE fk_player_id=? AND fk_game_id=?");
$stmt->bind_param('siiiii', $playertiles,$udraws,0,1,$playerid,$currgame);
$stmt->execute();
$stmt->bind_param('siiiii', ?,?,1,2,$playerid,$currgame);
$stmt->execute();
在第二个语句中,我不想更新前两个字段???这可以做到吗?
提前致谢。