unexpected T_STRING [closed]
I uploaded a php file to my server and I got this error:
Parse error: syntax error, unexpected T_STRING in /www/zzl.org/m/a/d/madebytheo/htdocs/cms/index.php on line 3
Here is line three:
mysql_connect (localhost, password, username) or die (mysql_error());
Any idea what's wrong?
EDIT It turned out to be the lack of quotes.
Ussually that kind of error is because some trivial typo. In this case, if the above code is your actual code, then you should use double quote to wrap localhost
, password
and username
.
Dollar signs(?) are missing.
mysql_connect($localhost, $password, $username) or die(mysql_error());
精彩评论