Jump to content

Archived

This topic is now archived and is closed to further replies.

turbocueca

Parse Error

Recommended Posts

Parse error: parse error, unexpected T_STRING in /home/vhosts/infocenter.90megs.com/index2.php on line 11

This 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]

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
(...)
$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);
(...)

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.