Forum Moderators: coopster

Message Too Old, No Replies

parse error

I get a parse error, but no further explanation

         

oaktown

8:15 pm on Mar 15, 2004 (gmt 0)

10+ Year Member



I surely could use some help with this. I have a site that someone else built with PHP. Some of the pages don't load. I am very, very new to php and when I look at what I suspect is the offending section of code, it appears identical to the same code on the pages that behave correctly.

<?php
$n = $HTTP_GET_VARS[ "n" ];

$mysql = mysql_connect( $hostname, $dbusername, $dbpasswd);
mysql_select_db( $databasename, $mysql );

$sql = "SELECT * FROM tblDictionary where DicStart = '" . 1C . "' order by DicName ASC";
?>

Any help would be most welcome. Thanks in advance.

willybfriendly

8:40 pm on Mar 15, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



What's the error?

WBF

ergophobe

8:43 pm on Mar 15, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



It should give you a line number for the parse error. Remember, the line of the actual syntax error can be the line of the parse error or anywhere above it. Never below.


$sql = "SELECT * FROM tblDictionary where DicStart = '" . 1C . "' order by DicName ASC";

It's clear why it doesn't work here. The PHP manuals says:


A valid constant name starts with a letter or underscore,

I suspect it works elsewhere because you have a valid constant or variable name.