準備済みステートメントを作成する方法を理解しようとしています。私は今これを持っています:
$stmt = $mysqli->stmt_init();
if($stmt->prepare("SELECT fk_player_id, player_draws, player_turn, player_passes, swapped FROM ".$prefix."_gameplayer WHERE fk_game_id = ? AND fk_player_id = ?")){
$stmt->bind_param('ii', $currgame, $playerid);
$stmt->execute();
$stmt->bind_result($playerid, $udraws, $uturn, $upass, $uswaps);
$stmt->fetch();
// HERE I WANT TO MAKE A NEW CALL //
$stmt->close();
}
エリアで// HERE I WANT TO MAKE A NEW CALL //これを実行したい:
$sql = mysql_query("SELECT fk_player_id, player_tiles, player_draws, player_turn, player_passes, swapped FROM ".$prefix."_gameplayer WHERE fk_game_id = $currgame AND fk_player_id != $playerid");
$row = mysql_fetch_assoc($sql);
$opponent = $row['fk_player_id'];
$oppTiles = $row['player_tiles'];
$odraws = $row['player_draws']+1;
$oturn = $row['player_turn'];
$opass = $row['player_passes'];
$oswaps = $row['swapped'];
= と != を除いて、2 つの呼び出しは同じです。これは同じステートメントで実行できますか?
前もって感謝します :-)