TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   The Lounge (http://www.talkphp.com/lounge/)
-   -   Coding errors (http://www.talkphp.com/lounge/4025-coding-errors.html)

KingOfTheSouth 03-07-2009 05:15 AM

Coding errors
 
Hey I know PHP but I am not really familiar with all the errors... Like I came across a error
Quote:

Parse error: syntax error, unexpected T_VARIABLE in /home1/clubbink/public_html/changestatus.php on line 8
I did not know what it meant and I still don't know what it meant.. If some could post like some basic errors like this and what it means I would appreciate it...

Thanks, King

Salathe 03-07-2009 11:31 AM

Most syntax errors are very basic typing mistakes: most often missing a semi-colon off of the end of the previous line of code, or not matching up your parenthesis pairs.

Wildhoney 03-07-2009 05:24 PM

Salathe is right.

I never really come across any PHP errors such as these any more. However, when I used a simple application for programming, such as Notepad, these errors were commonplace.

Try using Zend Studio or something similar. They will point out the syntax errors before you even attempt to execute the script.

Mathew 03-07-2009 09:39 PM

The error you have means it's come across a variable it wasn't expecting. You will have left out a ';'.

Read the error, it tells you exactly what's wrong.

KingOfTheSouth 03-07-2009 09:45 PM

Not always

Village Idiot 03-07-2009 10:41 PM

Quote:

Originally Posted by KingOfTheSouth (Post 22119)
Not always

That is because you have not properly investigated what the terms mean, but have simply defaulted to "I don't know what it means". Lets break this apart (all this information is available on Google)

Parse error: This means that it had a problem reading the code
syntax error, This means that the error lies within the grammatical structure of the program
unexpected T_VARIABLE this means that it found a variable when it did not expect one (IE when it is not allowed to be present).
in /home1/clubbink/public_html/changestatus.php on line 8 This provides the location where it ran into the error.

To basically, this message says that you placed a variable where it should not be on line eight. These errors are most commonly forgotten semi-colons, but can manifest themselves in forgetting or misplacing anything.

If that is not descriptive enough, I don't know what is.

Sakakuchi 03-07-2009 10:53 PM

Got this error last week to. What I had done was the following:

PHP Code:

    print <<< END
        Talk PHP rules :)
    END; 

and that is how it should like:
PHP Code:

print <<< END
        Talk PHP rules :)
END; 

The Token at the end may not have any tabs or spaces. -> So it didnt close the string - and gave that error to.

KingOfTheSouth 03-11-2009 02:02 AM

Yeah, I understand that


All times are GMT. The time now is 03:06 AM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0