我試圖展示所有與它類別相關的遊戲,我在這裏嘗試的Sql只顯示與遊戲相關的遊戲5,我該如何展示所有的遊戲自動?在同一頁顯示一排的所有結果
<?php
$varCategoria_GameData = "0";
if (isset($_GET["cat"])) {
$varCategoria_GameData = $_GET["cat"];
}
$sql_categoria = "SELECT * FROM jogos WHERE intCategoria =
(SELECT intCategoria FROM jogos WHERE idGames = 5)";
$query_categoria = mysql_query($sql_categoria, $gameconnection) or die(mysql_error());
$categoria = mysql_fetch_assoc($query_categoria);
?>
<?php do { ?>
<?php echo '<h1>'.$categoria['idGames'].'</h1>'; ?>
<?php } while ($categoria = mysql_fetch_assoc($query_categoria)); ?>
'SELECT * FROM jogos'測試此查詢 – 2013-07-08 20:21:27