4WebHelp
 FAQ  •  Search  •  User Groups  •  Forum Admins  •  Smilies List  •  Statistics  •  Rules   •  Login   •  Register
Toggle Navigation Menu

 A parse error on line 56
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic
Author Message
johnpend
Junior WebHelper
Junior WebHelper


Joined: 15 Mar 2004
Posts: 2
Location: California

PostPosted: Mon Mar 15, 2004 7:59 pm (13 years, 9 months ago) Reply with QuoteBack to Top

I have a site that is mostly PHP, but some of the pages don't load.

It reports a parse error on line 56, but give no further details.

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

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

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

I'm quite new at PHP and woefully inadequate at figuring this out on my own.

Any assistance will be gratefully received. Thanks in advance!

________________________________
I've fallen, and I can't get up!
OfflineView User's ProfileFind all posts by johnpendSend Personal MessageVisit Poster's WebsiteMSN Messenger
Daniel
Team Member



Joined: 06 Jan 2002
Posts: 2564

PostPosted: Mon Mar 15, 2004 8:12 pm (13 years, 9 months ago) Reply with QuoteBack to Top

What is on line 56 of said file? Wink

________________________________
Image
OfflineView User's ProfileFind all posts by DanielSend Personal Message
OllieMaitland
Junior WebHelper
Junior WebHelper


Joined: 06 Dec 2003
Posts: 25

PostPosted: Tue Mar 16, 2004 8:22 pm (13 years, 9 months ago) Reply with QuoteBack to Top

johnpend wrote:

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


You need to have a variable in the ". xx ." part to $iD would work but if you just want to use the string $1D you should use :

Code:

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


OR if it is a variable then:

Code:

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

________________________________
http://dev.byng-designs.com <- Things I'm working on
OfflineView User's ProfileFind all posts by OllieMaitlandSend Personal MessageSend email
johnpend
Junior WebHelper
Junior WebHelper


Joined: 15 Mar 2004
Posts: 2
Location: California

PostPosted: Wed Mar 17, 2004 7:52 pm (13 years, 9 months ago) Reply with QuoteBack to Top

Smile
Thanks loads folks!

Line 56 is:

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

what puzzles me is that it occurs when a 404 occurs.

The site is a medical dictionary. this occours when browsing by alphabet. For example, if you click on "27", you get a page listing links to several interior pages, each containing a definition of a word that begins with the numerals 27. If you click on "2H", you get the message "Parse error: parse error in /home/httpd/books.md/html/2/2H.php on line 56" and there are in fact, no pages for anything beginning with "2H".

thanks again for the responses! I hope this info will help you further in sleuthing this out!

________________________________
I've fallen, and I can't get up!
OfflineView User's ProfileFind all posts by johnpendSend Personal MessageVisit Poster's WebsiteMSN Messenger
Display posts from previous:      
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic


 Jump to:   




You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot edit your posts in this forum.
You cannot delete your posts in this forum.
You cannot vote in polls in this forum.


Page generation time: 0.050979 seconds :: 17 queries executed :: All Times are GMT
Powered by phpBB 2.0 © 2001, 2002 phpBB Group :: Based on an FI Theme