LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 04-28-2009, 02:22 AM   #1
chakaox
LQ Newbie
 
Registered: Apr 2009
Posts: 2

Rep: Reputation: 0
Parse error syntax error unexpected '{ ' on line


Hi
I am working on my Guest Entry which connect mysql databse.

I am getting error saying "Parse error syntax error unexpected "{"
Here is my code
<?php
$username='#####';
$password='#####';
$hostname='#####.db';
$databsename='#####';
$conection = @mysql_connect($hostname, $username, $password);
mysql_select_db($hostname,$conection);

$SQL="SELECT*From Guestbook";
$Content= mysql_query($SQL);

while ($rs= mysql_fetch_array( mysql_query($SQL)) {
echo "$rs[EntryText]";
}
?>

i don't see any problem but i am new to php.

Thank you
 
Old 04-28-2009, 02:32 AM   #2
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,225

Rep: Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021
Well, in the 'while line, you've got 3 '(', but only 2 ')' so that's a problem.
You should try an editor with syntax highlighting eg vim.
Personally for loops, i like to line up the start/end parentheses vertically. Easier to eyeball that they match up.
 
Old 04-29-2009, 03:27 AM   #3
chakaox
LQ Newbie
 
Registered: Apr 2009
Posts: 2

Original Poster
Rep: Reputation: 0
thank you!!! it works now!! thanks again!!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP Error Parse error: parse error, unexpected $ in /home/content/S/k/i/SkinCare4U/h CowanServices Programming 2 12-09-2008 08:26 PM
Parse error: parse error, unexpected '}' in /home/content jouvert Linux - Newbie 3 05-17-2008 06:55 PM
Backup Script error "line 31: syntax error: unexpected end of file" eswanepoel General 7 12-07-2007 09:28 AM
Parse error: parse error, unexpected $ in /home/content/d/o/m/domain/html/addpuppy2.p Scooby-Doo Programming 3 10-25-2007 09:41 AM
got a syntax error which shows unexpected end of line when tried to run a shell scrip racer_mec Linux - Newbie 1 01-10-2005 01:43 AM


All times are GMT -5. The time now is 02:45 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration