我正在开发一个在线游戏网站,我想要实现的是,当我在玩游戏时,我想在同一页面中显示与当前所玩游戏类别相关的所有游戏。例如:我正在玩 id = 4 并且该游戏的类别为 = 3 的游戏。我想显示与类别 3 相关的所有游戏。等等。谢谢
CREATE TABLE IF NOT EXISTS `jogos` (
`idGames` int(11) NOT NULL AUTO_INCREMENT,
`strNome` varchar(100) DEFAULT NULL,
`intCategoria` int(11) DEFAULT NULL,
$varCategoria_GameData = "0";
if (isset($_GET["cat"])) {
$varCategoria_GameData = $_GET["cat"];
}
mysql_select_db($database_gameconnection, $gameconnection);
$query_GameData = sprintf("SELECT * FROM jogos WHERE jogos.intCategoria = %s", GetSQLValueString($varCategoria_GameData, "int"));
$GameData = mysql_query($query_GameData, $gameconnection) or die(mysql_error());
$row_GameData = mysql_fetch_assoc($GameData);
$totalRows_GameData = mysql_num_rows($GameData);
if (!isset($_SESSION)) {
session_start();
}?>