944,008 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Marked Solved
  • Views: 1377
  • PHP RSS
Mar 23rd, 2007
0

find the parse error

Expand Post »
ive got a Parse error: syntax error, unexpected T_VARIABLE


on this line:
PHP Syntax (Toggle Plain Text)
  1. $dboutput = "//database vars \n" "$dbtype = '".$dbtype."'; \n" "$dbhost = '".$dbhost."'; \n""$dbtype = '".$dbtype."'; \n""$dbname = '".$dbname."'; \n""$dbport = '".$dbport."'; \n""\n" "$database = array($dbtype, $dbhost, $dbname, $dbpass, $dbport);";
any idea of whats wrong with it?
Last edited by hunkychop; Mar 23rd, 2007 at 11:20 pm. Reason: more info
Similar Threads
Reputation Points: 13
Solved Threads: 4
Junior Poster in Training
hunkychop is offline Offline
55 posts
since Mar 2007
Mar 23rd, 2007
0

Re: find the parse error

(sory for not editing, it wouldent let me)

i changed the script to this, and i stil have problems:
PHP Syntax (Toggle Plain Text)
  1. $dboutput = "//database vars \n"."$dbtype = '".$dbtype."'; \n". "$dbhost = '".$dbhost."'; \n"."$dbtype = '".$dbtype."'; \n"."$dbname = '".$dbname."'; \n"."$dbport = '".$dbport."'; \n"."\n". "$database = array($dbtype, $dbhost, $dbname, $dbpass, $dbport);";
Reputation Points: 13
Solved Threads: 4
Junior Poster in Training
hunkychop is offline Offline
55 posts
since Mar 2007
Mar 24th, 2007
0

Re: find the parse error

I tested your last version:

I did not get any errors. If you still get the error,maybe in the statement previous to this one, the ";" is missing.
i have done this kind of errors several times .
Reputation Points: 10
Solved Threads: 1
Newbie Poster
jgutierrez@mail is offline Offline
2 posts
since Nov 2005
Mar 24th, 2007
0

Re: find the parse error

Parse errors usually do not show the correct line number in the error msg. Usually its the line just before the one given, like jgutierrez@mail pointed out...
Moderator
Reputation Points: 457
Solved Threads: 101
Nearly a Posting Virtuoso
digital-ether is offline Offline
1,250 posts
since Sep 2005

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: Help
Next Thread in PHP Forum Timeline: undefined variable error





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC