I'm trying to show all the games related to the category of the current game played. But I'm getting a parse error in "if (!empty($_GET['gameId'])) $varGameId = $_GET['gameId'];"

How can I solve this?

Thank you

<?php
$varCategoria_GameData = "0";
$varGameId = 0
if (!empty($_GET['gameId'])) $varGameId  = $_GET['gameId'];
if (isset($_GET["cat"])) {
 $varCategoria_GameData = $_GET["cat"];
}

$sql_categoria = "SELECT * FROM jogos WHERE intCategoria =
( SELECT intCategoria FROM jogos WHERE idGames = $varGameId )";
$query_categoria = mysql_query($sql_categoria, $gameconnection) or die(mysql_error()); 
$categoria = mysql_fetch_assoc($query_categoria);

?> 
有帮助吗?

解决方案

The error is here, semi-colon missing:

$varGameId = 0

其他提示

You miss semi colon here: $varGameId = 0

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top