0

Hi all, newbie here but I've got a question and HOPEFULLY someone can assist me here. I'm getting an error that says its on the LAST LINE of my code. Here's the error:

Parse error: syntax error, unexpected ';' in /home/editedreg.php on line 113

Now here's the final lines of the code where this error should be.

$answer = $tSQL->Query("SELECT * FROM `players` WHERE `username` = '" . $username . "' AND `password` = '" . $password . "';");
if (intval($answer[0]) > 0)
{
return true;
}
else
{
return false;
}
$tSQL->Disconnect();
unset($tSQL);
}
                
                if ($qresult) Stop("You successfully got registered");
                else echo Stop("Some mistake with writing to DB");
                [b]([/b]
?>

I put line 113 in bold so you all knew. It's hard to see since the only thing on the line is a "(". Seriously, there is no ";" in the area. What's the deal?

3
Contributors
3
Replies
4
Views
10 Years
Discussion Span
Last Post by Ezzaral
0

change the last lines to this:

if ($qresult)
{
echo "You successfully got registered";
}
else
{
echo "We apologize, there was a mistake with writing the information to the DB";
}

0

Thank you. However, now I get

Parse error: syntax error, unexpected $end

Missing curly bracket? :P

Edited by __avd: fixed formatting.

0

Looks to me like an extra end brace here, but it is difficult to say since you only posted a fragment of the code

}
$tSQL->Disconnect();
unset($tSQL);
}

Side note: proper indentation of your code blocks would help you spot these things more easily.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.