turbocueca Posted March 13, 2006 Share Posted March 13, 2006 Parse error: parse error, unexpected T_STRING in /home/vhosts/infocenter.90megs.com/index2.php on line 11This is the error that my page does. What is the cause of this and how can I fix it?This is the link to the page with the error:[a href=\"http://infocenter.90megs.com/index2.php\" target=\"_blank\"]http://infocenter.90megs.com/index2.php[/a] Quote Link to comment https://forums.phpfreaks.com/topic/4863-parse-error/ Share on other sites More sharing options...
php_b34st Posted March 13, 2006 Share Posted March 13, 2006 Post some code (especially line 11) and someone will be able to help Quote Link to comment https://forums.phpfreaks.com/topic/4863-parse-error/#findComment-17095 Share on other sites More sharing options...
kenrbnsn Posted March 13, 2006 Share Posted March 13, 2006 Actually, you should post the lines before line 11 as well as line 11. Errors like this are, very often, is a line preceding the one where the error is reported.Ken Quote Link to comment https://forums.phpfreaks.com/topic/4863-parse-error/#findComment-17101 Share on other sites More sharing options...
turbocueca Posted March 13, 2006 Author Share Posted March 13, 2006 (...) $selecao=mysql_select_db ("5684",$connection); $consulta="CREATE TABLE turma (codigo INT AUTO_INCREMENT PRIMARY KEY, aluno CHAR(30), idade INT, email CHAR (40))"; $execucao=mysql_query($consulta,$connection); $registo="INSERT INTO turma (aluno,idade,email) VALUES ("Anibal Varalonga",16,"anibal_paolo@hotmail.com")"; [b][Line11][/b] $insercao=mysql_query($registo,$connection);(...) Quote Link to comment https://forums.phpfreaks.com/topic/4863-parse-error/#findComment-17112 Share on other sites More sharing options...
kenrbnsn Posted March 13, 2006 Share Posted March 13, 2006 In this line[code]<?php $registo="INSERT INTO turma (aluno,idade,email) VALUES ("Anibal Varalonga",16,"anibal_paolo@hotmail.com")"; ?>[/code]You have double quotes inside a string delimited by double quotes. The inside double quotes should be single quotes, since MySQL delimite strings with single quotes.[code]<?php $registo="INSERT INTO turma (aluno,idade,email) VALUES ('Anibal Varalonga', 16, 'anibal_paolo@hotmail.com')"; ?>[/code]Ken Quote Link to comment https://forums.phpfreaks.com/topic/4863-parse-error/#findComment-17120 Share on other sites More sharing options...
turbocueca Posted March 13, 2006 Author Share Posted March 13, 2006 thanks pal, it did it. Quote Link to comment https://forums.phpfreaks.com/topic/4863-parse-error/#findComment-17138 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.