Echo Syntax Error
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more syntax error unexpected echo t_echo about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users parse error syntax error unexpected echo Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each syntax error near unexpected token echo other. Join them; it only takes a minute: Sign up PHP Echo syntax error with single quote or double quotes? up vote 10 down vote favorite The is a very simple echo statement but I can't solve it? parse error syntax error unexpected 'echo' (t_echo) in php echo '"What is your name?'"; php share|improve this question edited Jun 7 '10 at 8:58 Jeff Atwood♦ 39.1k41131145 asked Jun 7 '10 at 5:24 Starx 49.3k25122217 12 Why does stuff like this get voted down? –Daniel Harms Jun 7 '10 at 5:28 9 @Precision I can't really see how this question could help anyone else. What would they search for to find this? "my code is wrong"? Even rewording the question to make it useful
Parse Error: Syntax Error, Unexpected 'echo' (t_echo), Expecting ',' Or ';'
is pointless. If someone knew what to search for (eg "mismatched quotes"), then they would have already solved their problem. Even the most basic of debugging (eg just looking at your syntax highlighting) would show the error here. We all have dumb errors like this which you can't figure out straight away, and I don't think there's anything wrong with asking it, but it's pretty obvious why it'd get voted down. –nickf Jun 7 '10 at 7:14 @nickf I agree, but the answerers seem to enjoy this one, so I gave it my best shot as a title edit –Jeff Atwood♦ Jun 7 '10 at 8:46 @Jeff you've made it much worse. Because there are very popular terrible rumor about a question you made a title. While the question itself was about syntax error, not quote styles. –Your Common Sense Jun 7 '10 at 8:50 @col good point, I added "syntax error" –Jeff Atwood♦ Jun 7 '10 at 8:58 | show 1 more comment 6 Answers 6 active oldest votes up vote 0 down vote accepted echo "What is your name?"; This is Simply the best. No confusion No problem..:) share|improve this answer edited Apr 28 '11 at 10:51 Starx 49.3k25122217 answered Jun 7 '10 at 9:26 Neeraj 3214 add a comment| up vote 25 down vote Mismatch of single quotes, use this: e
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn
Echo Php
more about Stack Overflow the company Business Learn more about hiring developers or php checker posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Parse error: syntax error, unexpected T_ECHO in [closed] up vote http://stackoverflow.com/questions/2987239/php-echo-syntax-error-with-single-quote-or-double-quotes 2 down vote favorite What is causing this error? Parse error: syntax error, unexpected T_ECHO in C:\wamp\www\game\rankings.php on line 19 Here is the code
Battle Players
Rank | Username | Gold |
". $row['overall']. " | "; $get_user = mysql_query("SELECT `username` FROM `user` WHERE `id`='".$row['id']."'") or die(mysql_error()); $rank_name = mysql_fetch_assoc($get_user); echo "" . $rank_name['username'] . " | "; $get_gold = mysql_query("SELECT `gold` FROM `stats` WHERE `id`='".$row['id']."'") or die(mysql_error()); $rank_gold = mysql_fetch_assoc($get_gold); echo "" . number_format($rank_gold['gold']) . " | "; echo "
Frames Image Optimizer FavIcon Generator FavIcon Editor new Animated Gif Email http://www.dynamicdrive.com/forums/showthread.php?71785-Parse-error-syntax-error-unexpected-echo Riddler .htaccess Password .htaccess Banning Gradient Image Button Maker Ribbon Rules List Scrubber Tool DD Whois Service Register Help Remember Me? Advanced Search DD Home Forum New Posts FAQ Calendar Forum Actions Mark Forums Read Quick Links Today's Posts View Site Leaders What's New? Blogs Forum General Coding PHP syntax error Resolved Parse error: syntax error unexpected 'echo' If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you syntax error unexpected want to visit from the selection below. Results 1 to 4 of 4 Thread: Parse error: syntax error unexpected 'echo' Thread Tools Show Printable Version Subscribe to this Thread… Search Thread Advanced Search 10-21-2012,07:14 PM #1 Kage Kazumi View Profile View Forum Posts Private Message View Blog Entries Visit Homepage Junior Coders Join Date Oct 2012 Posts 66 Thanks 0 Thanked 0 Times in 0 Posts Parse error: syntax error unexpected 'echo' This error pops for the following line: PHP Code: if(isset($error))(echo'
EDIT If I change "echo" to "print" it returnes no errors, but then it messes up the page layout and prints the following in the upper left corner: PHP Code: array(