soc86 Posted September 12, 2011 Share Posted September 12, 2011 Problem connecting? Parse error: syntax error, unexpected T Postby soc86 » Mon Sep 12, 2011 6:24 am I keep getting the following error: Parse error: syntax error, unexpected T_STRING in W:\www\blog\index.php on line 2 For some reason if you look at my code i believe there is something wrong with the php connecting to my sql database: <?php mysql_connect('localhost','root','root'); mysql_select_db('blog'); ?> <html> <head> <title>Show Me Blog</title> </head> <body> Here is my blog<hr/> <table border='1'> <tr><td>Blog Title</td><td>category</td></tr> <tr><td colspan='2'>content</td><td></tr> </table> </body> </html> I am using uniform server http://www.uniformserver.com/ and i have checked and my username and password is root? Quote Link to comment https://forums.phpfreaks.com/topic/246980-parse-error-syntax-error-unexpected-t_string-in-wwwwblogindexphp-on-line/ Share on other sites More sharing options...
Pikachu2000 Posted September 12, 2011 Share Posted September 12, 2011 The code you've posted contains no errors. Is that an actual copy/paste of the code that's producing the problem? Quote Link to comment https://forums.phpfreaks.com/topic/246980-parse-error-syntax-error-unexpected-t_string-in-wwwwblogindexphp-on-line/#findComment-1268423 Share on other sites More sharing options...
AyKay47 Posted September 12, 2011 Share Posted September 12, 2011 this doesn't make much sense.. are you sure this is the relevant code.. as to your other inquiry.. if your password for your mysql server is "root", then that should be correct Quote Link to comment https://forums.phpfreaks.com/topic/246980-parse-error-syntax-error-unexpected-t_string-in-wwwwblogindexphp-on-line/#findComment-1268430 Share on other sites More sharing options...
soc86 Posted September 12, 2011 Author Share Posted September 12, 2011 I dont understand? Quote Link to comment https://forums.phpfreaks.com/topic/246980-parse-error-syntax-error-unexpected-t_string-in-wwwwblogindexphp-on-line/#findComment-1268432 Share on other sites More sharing options...
Adam Posted September 12, 2011 Share Posted September 12, 2011 I have run into a similar issue to this before, some kind of encoding issue or something. I never really got to the bottom of it. Just copy the contents of the file, delete it (on the server as well), and recreate it. Worked for me.. Quote Link to comment https://forums.phpfreaks.com/topic/246980-parse-error-syntax-error-unexpected-t_string-in-wwwwblogindexphp-on-line/#findComment-1268440 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.