parser problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
sky2070
Forum Newbie
Posts: 1
Joined: Thu May 08, 2003 1:51 am

parser problem

Post by sky2070 »

i create this php file to connect to a table guestbook in a database name guestbook

<?php
mysql_connect("localhost", "", "");
mysql_select_db("guestbook");
$result = mysql_query("select * from guestbook") or
die ( mysql_error() );
echo mysql_result($result,0,0);
?>

the browse return this error message

Parse error: parse error, unexpected T_STRING in c:\inetpub\wwwroot\database.php on line 4

can anymore tell me what is T_STRING and how to solve this problem :roll:
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

I don't get a parse error when I run your code, did you copy and paste your current code or retype it? You'll generally get a T_STRING message when you've forgotten to close some quotes on a string somewhere and PHP comes up against another string (same if, for example, you've forgotten to escape double quotes in a double quoted string).


Mac
Post Reply