Jump to content

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]
Link to comment
https://forums.phpfreaks.com/topic/4863-parse-error/
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);
(...)
Link to comment
https://forums.phpfreaks.com/topic/4863-parse-error/#findComment-17112
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
Link to comment
https://forums.phpfreaks.com/topic/4863-parse-error/#findComment-17120
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.