Jump to content


Photo

Parse Error


  • Please log in to reply
5 replies to this topic

#1 turbocueca

turbocueca
  • Members
  • PipPipPip
  • Advanced Member
  • 62 posts

Posted 13 March 2006 - 07:16 PM

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]

#2 php_b34st

php_b34st
  • Members
  • PipPipPip
  • Advanced Member
  • 168 posts

Posted 13 March 2006 - 07:24 PM

Post some code (especially line 11) and someone will be able to help

#3 kenrbnsn

kenrbnsn
  • Staff Alumni
  • Advanced Member
  • 8,235 posts
  • LocationHillsborough, NJ, USA

Posted 13 March 2006 - 07:34 PM

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

#4 turbocueca

turbocueca
  • Members
  • PipPipPip
  • Advanced Member
  • 62 posts

Posted 13 March 2006 - 07:42 PM

(...)
$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")"; [Line11]
$insercao=mysql_query($registo,$connection);
(...)

#5 kenrbnsn

kenrbnsn
  • Staff Alumni
  • Advanced Member
  • 8,235 posts
  • LocationHillsborough, NJ, USA

Posted 13 March 2006 - 08:03 PM

In this line
<?php $registo="INSERT INTO turma (aluno,idade,email) VALUES ("Anibal Varalonga",16,"anibal_paolo@hotmail.com")"; ?>
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.
<?php $registo="INSERT INTO turma (aluno,idade,email) VALUES ('Anibal Varalonga', 16, 'anibal_paolo@hotmail.com')"; ?>

Ken

#6 turbocueca

turbocueca
  • Members
  • PipPipPip
  • Advanced Member
  • 62 posts

Posted 13 March 2006 - 09:04 PM

thanks pal, it did it.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users