Parse error: parse error, unexpected T_VARIABLE in line 5

Codes here !

Moderators: macek, egami, gesf

nvinaya
New php-forum User
New php-forum User
Posts: 3
Joined: Mon Jun 23, 2003 3:40 pm

Parse error: parse error, unexpected T_VARIABLE in line 5

Postby nvinaya » Mon Jun 23, 2003 3:51 pm

hi,
this is the error i am getting....any help would be great..
i am using apache, php and mysql on windows nt....

Parse error: parse error, unexpected T_VARIABLE in Line 5


My code:

<body>
hello <?php echo "<p>hello world</p>"?>
<? php
$connect = mysql_connect('localhost', 'root','');
if ($connect==FALSE) {
print "Database connection failed";
exit;
}


?>
</body>
</html>

liquedus
php-forum Active User
php-forum Active User
Posts: 266
Joined: Tue Apr 08, 2003 5:18 am
Location: Ottawa, Canada
Contact:

Postby liquedus » Mon Jun 23, 2003 6:53 pm

<body>
hello <?php echo "<p>hello world</p>"?>
<?php <-- This had a space
$connect = mysql_connect('localhost', 'root','');
if ($connect==FALSE) {
print "Database connection failed";
exit;
}


?>
</body>
</html>

nvinaya
New php-forum User
New php-forum User
Posts: 3
Joined: Mon Jun 23, 2003 3:40 pm

Postby nvinaya » Mon Jun 23, 2003 7:43 pm

hi
thanks for the reply...i removed the space and i still get the same error...
this is what i have now..
<html>
<body>
hello <?php echo "<p>hello world</p>"?>
<? php $connect = mysql_connect('localhost', 'root','');
if ($connect==FALSE) {
print "Database connection failed";
exit;
}
?>
</body>
</html>


thanks

nvinaya
New php-forum User
New php-forum User
Posts: 3
Joined: Mon Jun 23, 2003 3:40 pm

it works

Postby nvinaya » Mon Jun 23, 2003 9:32 pm

thanks...
it works now...
took off the space between the ? and php...


Return to “mySQL & php coding”

Who is online

Users browsing this forum: No registered users and 1 guest