i’m a iphone programmer, and not so great in php and mysql. My question is that i have a online highscore system, which has 3 tables for all my modes in the game. I am trying to select the table based on the input from a GET variable, but it doesn’t work. This is my code in php.
$typeGame = isset($_GET['type']) ? $_GET['type'] : "";
$typeGame = mysql_real_escape_string($type);
if ($typeGame === "Sprint") {
$table = "highscoresSprint";
}
else if ($typeGame === "Normal")
{
$table = "highscoresNormal";
}
else
{
$table = "highscoresMarathon";
}
Where typeGame the type of game is which is requested, and $table the table is.
I hope that you can help me, it just won’t work.
Cheers, Joe.
Try:
instead of: