unexpected T_VARIABLE

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
mikes1471
Forum Commoner
Posts: 88
Joined: Sat Jan 24, 2009 3:29 pm

unexpected T_VARIABLE

Post by mikes1471 »

Hi Guys

When running this connection script it generates this response:
"Parse error: syntax error, unexpected T_VARIABLE in /var/www/vhosts/picfrisky.com/httpdocs/new/connect.php on line 6"

line 6 is this:

Code: Select all

$connect = mysql_connect("picfrisky.com","user_1","xxxxx") or die($error);

Code: Select all

<?php
//connect script
 
$error = "Problem connecting to the database. Please try again later on."
 
$connect = mysql_connect("picfrisky.com","user_1","xxxxx") or die($error);
mysql_select_db("users_db") or die($error);
 
?>
I'm just hoping someone can advise me where I've gone wrong as looking up other peoples articles on "unexpected T_VARIABLE" tends to generate some pretty non specific problems

Thanks in advance
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: unexpected T_VARIABLE

Post by Christopher »

Please do not post passwords.

You don't have a semicolon at the end of line 4.
(#10850)
mikes1471
Forum Commoner
Posts: 88
Joined: Sat Jan 24, 2009 3:29 pm

Re: unexpected T_VARIABLE

Post by mikes1471 »

Thanks and the password is a dummy
Post Reply