LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Parse error syntax error unexpected '{ ' on line (https://www.linuxquestions.org/questions/programming-9/parse-error-syntax-error-unexpected-%7B-on-line-722164/)

chakaox 04-28-2009 02:22 AM

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

chrism01 04-28-2009 02:32 AM

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.

chakaox 04-29-2009 03:27 AM

thank you!!! it works now!! thanks again!!


All times are GMT -5. The time now is 03:49 AM.