Getting crazy!

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Perfidus
Forum Contributor
Posts: 114
Joined: Sun Nov 02, 2003 9:54 pm

Getting crazy!

Post by Perfidus »

Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in /chs/p1/costa4seasons.com/home/html/procesandoreserva.php on line 468

My code stumbles always here, in the first line of the code that follows.
Is it wrong or what is going on?

Code: Select all

<?php

if ($row['ene1t']!=0){echo"<p>$row['ene1t']<p>";}
if ($row['ene2t']!=0){echo"<p>$row['ene2t']</p>";}
if ($row['ene3t']!=0){echo"<p>$row['ene3t']</p>";}
if ($row['ene4t']!=0){echo"<p>$row['ene4t']</p>";}
if ($row['ene5t']!=0){echo"<p>$row['ene5t']</p>";}
if ($row['feb1t']!=0){echo"<p>$row['feb1t']</p>";}
if ($row['feb2t']!=0){echo"<p>$row['feb2t']</p>";}
if ($row['feb3t']!=0){echo"<p>$row['feb3t']</p>";}
if ($row['feb4t']!=0){echo"<p>$row['feb4t']</p>";}
if ($row['feb5t']!=0){echo"<p>$row['feb5t']</p>";}
if ($row['mar1t']!=0){echo"<p>$row['mar1t']</p>";}
if ($row['mar2t']!=0){echo"<p>$row['mar2t']</p>";}
if ($row['mar3t']!=0){echo"<p>$row['mar3t']</p>";}
if ($row['mar4t']!=0){echo"<p>$row['mar4t']</p>";}
if ($row['mar5t']!=0){echo"<p>$row['mar5t']</p>";}
if ($row['abr1t']!=0){echo"<p>$row['abr1t']</p>";}
if ($row['abr2t']!=0){echo"<p>$row['abr2t']</p>";}
if ($row['abr3t']!=0){echo"<p>$row['abr3t']</p>";}
if ($row['abr4t']!=0){echo"<p>$row['abr4t']</p>";}
if ($row['abr5t']!=0){echo"<p>$row['abr5t']</p>";}
if ($row['may1t']!=0){echo"<p>$row['may1t']</p>";}
if ($row['may2t']!=0){echo"<p>$row['may2t']</p>";}
if ($row['may3t']!=0){echo"<p>$row['may3t']</p>";}
if ($row['may4t']!=0){echo"<p>$row['may4t']</p>";}
if ($row['may5t']!=0){echo"<p>$row['may5t']</p>";}
if ($row['jun1t']!=0){echo"<p>$row['jun1t']</p>";}
if ($row['jun2t']!=0){echo"<p>$row['jun2t']</p>";}
if ($row['jun3t']!=0){echo"<p>$row['jun3t']</p>";}
if ($row['jun4t']!=0){echo"<p>$row['jun4t']</p>";}
if ($row['jun5t']!=0){echo"<p>$row['jun5t']</p>";}
if ($row['jul1t']!=0){echo"<p>$row['jul1t']</p>";}
if ($row['jul2t']!=0){echo"<p>$row['jul2t']</p>";}
if ($row['jul3t']!=0){echo"<p>$row['jul3t']</p>";}
if ($row['jul4t']!=0){echo"<p>$row['jul4t']</p>";}
if ($row['jul5t']!=0){echo"<p>$row['jul5t']</p>";}
if ($row['ago1t']!=0){echo"<p>$row['ago1t']</p>";}
if ($row['ago2t']!=0){echo"<p>$row['ago2t']</p>";}
if ($row['ago3t']!=0){echo"<p>$row['ago3t']</p>";}
if ($row['ago4t']!=0){echo"<p>$row['ago4t']</p>";}
if ($row['ago5t']!=0){echo"<p>$row['ago5t']</p>";}
if ($row['sep1t']!=0){echo"<p>$row['sep1t']</p>";}
if ($row['sep2t']!=0){echo"<p>$row['sep2t']</p>";}
if ($row['sep3t']!=0){echo"<p>$row['sep3t']</p>";}
if ($row['sep4t']!=0){echo"<p>$row['sep4t']</p>";}
if ($row['sep5t']!=0){echo"<p>$row['sep5t']</p>";}
if ($row['oct1t']!=0){echo"<p>$row['oct1t']</p>";}
if ($row['oct2t']!=0){echo"<p>$row['oct2t']</p>";}
if ($row['oct3t']!=0){echo"<p>$row['oct3t']</p>";}
if ($row['oct4t']!=0){echo"<p>$row['oct4t']</p>";}
if ($row['oct5t']!=0){echo"<p>$row['oct5t']</p>";}
if ($row['nov1t']!=0){echo"<p>$row['nov1t']</p>";}
if ($row['nov2t']!=0){echo"<p>$row['nov2t']</p>";}
if ($row['nov3t']!=0){echo"<p>$row['nov3t']</p>";}
if ($row['nov4t']!=0){echo"<p>$row['nov4t']</p>";}
if ($row['nov5t']!=0){echo"<p>$row['nov5t']</p>";}
if ($row['dic1t']!=0){echo"<p>$row['dic1t']</p>";}
if ($row['dic2t']!=0){echo"<p>$row['dic2t']</p>";}
if ($row['dic3t']!=0){echo"<p>$row['dic3t']</p>";}
if ($row['dic4t']!=0){echo"<p>$row['dic4t']</p>";}
if ($row['dic5t']!=0){echo"<p>$row['dic5t']</p>";}

?>
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post by m3mn0n »

Code: Select all

<?php
if ($row['ene1t'] != 0)
{
  echo"<p>".$row['ene1t']."<p>";
}
?>
How does that work?
ghost007
Forum Commoner
Posts: 49
Joined: Sat Nov 22, 2003 10:10 am

Post by ghost007 »

you should look higher in your code if you did not forgot to close brackets or end a line with ;

post the whole page if you don't find it. I will have a look.

cheers
Siech
AnsonM
Forum Commoner
Posts: 72
Joined: Thu Sep 25, 2003 7:21 am

Post by AnsonM »

which is line 468??
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

Sami's right.
Do not quote literal element names within double-quoted literals

Code: Select all

echo"<p>".$row['ene1t']."<p>"; 
// but
echo"<p>$row[ene1t]<p>";
Post Reply