I have an error within this PHP else if statement (which is part of an if statement):
Parse error: syntax error, unexpected '}' in /home1/tony1964/public_html/2v2tournaments/action.php
The place where the unexpected '}' is at the end of the code below. I can't figure out why this doesn't work. Thanks in advance for any help.
else if (isset($_GET['do']) && $_GET['do'] === "reg_type_2") {
include('php-riot-api.php');
$summoner_name_input = $_POST['summonername'];
$summoner_name = str_replace(' ', '_', $summoner_name_input);
$summoner_region = $_POST['summonerregion'];
$verify_code_input = $_POST['verify_code'];
$verify_code = str_replace(' ', '_', $verify_code_input);
$instance = new riotapi($summoner_region);
$grab_data = $instance->getSummonerByName($summoner_name);
$decode_data = json_decode($grab_data);
$grab_id = $decode_data->{'id'};
var_dump($grab_id);
$grab_runes = $instance->getSummoner($grab_id,'runes');
$decode_runes = json_decode($grab_runes);
$rune_check = $decode_runes->{'name'};
if ($rune_check = $verify_code) {
$logged_user = $_SESSION['logged_user'];
if (!($stmt = $con->prepare("INSERT INTO `verified_summoners` (`Username`,`SummonerName`,`SummonerRegion`) VALUES (?,?,?)")) || !is_object($stmt)) {
die( "Error preparing: (" .$con->errno . ") " . $con->error);
}
$stmt->bind_param('sss', $logged_user, $summoner_name, $summoner_region);
if($stmt->execute()) {
echo "Successfully Verified! Check out your new list! <a class='content' href='index.php'><span class='button color_yellow'>Return</span></a>";
} else {
echo "Unsuccessful INSERT, Contact Support or Try again...";
}
$stmt->close();
}
} else {
echo "O Dear, It didn't work! Try Again!";
}
}
{
and}
are... This is obviously just a simple typo, so voting to close. – Marc B Jan 30 at 14:37}
removed from @Ryan's answer should do the trick. – Vincent Wilkie Jan 30 at 14:44people don't like scrolling horizontally
? I'm sure anyone would agree that it's 100x easier to "scroll horizontally" than it is to read code in the format it's currently in. – Ryan Jan 30 at 14:47