Pergunta

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);

?> 
Foi útil?

Solução

The error is here, semi-colon missing:

$varGameId = 0

Outras dicas

You miss semi colon here: $varGameId = 0

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top