Thursday, July 30, 2009

Problems connecting to MySql from PHP?

Hello all. I'm brand new to the whole PHP mysql thing.





OK here is the error I get:





Parse error: syntax error, unexpected T_STRING in C:\xampp\htdocs\latin.php on line 5





This is line 5:





mysql_connect('localhost','root',' ');





What am I doing wrong here?





Note: My mysql password is blank.

Problems connecting to MySql from PHP?
make sure your mysql server is properly setup to receive traffic on localhost port.


Also, the t_string error could be from another line in your php code. Use a php coder application to check for errors.
Reply:Take out the ' '
Reply:Often the problem is a syntax error on a previous line, so take a look at the few lines before line 5.


No comments:

Post a Comment