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?

Recommended Answers

All 3 Replies

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";
}

Thank you. However, now I get

Parse error: syntax error, unexpected $end

Missing curly bracket? :P

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.