Unexpected error that doesn't exist

Reply

Join Date: Sep 2007
Posts: 2
Reputation: emucat is an unknown quantity at this point 
Solved Threads: 0
emucat emucat is offline Offline
Newbie Poster

Unexpected error that doesn't exist

 
0
  #1
Sep 3rd, 2007
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");
                (
?>

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?
Reply With Quote Quick reply to this message  
Join Date: Aug 2007
Posts: 52
Reputation: JeniF is an unknown quantity at this point 
Solved Threads: 5
JeniF's Avatar
JeniF JeniF is offline Offline
Junior Poster in Training

Re: Unexpected error that doesn't exist

 
0
  #2
Sep 4th, 2007
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";
}
I keep hitting "escape", but I'm still here!!!!
:}
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 2
Reputation: emucat is an unknown quantity at this point 
Solved Threads: 0
emucat emucat is offline Offline
Newbie Poster

Re: Unexpected error that doesn't exist

 
0
  #3
Sep 4th, 2007
Thank you. However, now I get

[quote[
Parse error: syntax error, unexpected $end[/quote]

Missing curly bracket?
Reply With Quote Quick reply to this message  
Join Date: May 2007
Posts: 4,515
Reputation: Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future 
Solved Threads: 523
Moderator
Featured Poster
Ezzaral's Avatar
Ezzaral Ezzaral is offline Offline
Industrious Poster

Re: Unexpected error that doesn't exist

 
0
  #4
Sep 4th, 2007
Looks to me like an extra end brace here, but it is difficult to say since you only posted a fragment of the code
  1. }
  2. $tSQL->Disconnect();
  3. unset($tSQL);
  4. }
Side note: proper indentation of your code blocks would help you spot these things more easily.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the PHP Forum


Views: 1154 | Replies: 3
Thread Tools Search this Thread



Tag cloud for PHP
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC