kdford10 Posted December 12, 2009 Share Posted December 12, 2009 I am testing my script on the web, but it says a Parse error: syntax error, unexpected T_STRING in line 5. I have researched everywhere, and I don't see the error. Do you? <?php function myproject_connect () { $dbh = new PDO("mysql:host=localhost;dbname="custom", "username", "password"); $dbh->setAttribute (PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); return ($dbh); } ?> Link to comment https://forums.phpfreaks.com/topic/184857-parse-error-syntax-error-unexpected-t_string/ Share on other sites More sharing options...
dawsba Posted December 12, 2009 Share Posted December 12, 2009 <?php function myproject_connect () { $dbh = new PDO("mysql:host=localhost;dbname='custom'", "username", "password"); $dbh->setAttribute (PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); return ($dbh); } ?> Link to comment https://forums.phpfreaks.com/topic/184857-parse-error-syntax-error-unexpected-t_string/#findComment-975800 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.