I'm trying to establish a new PDO instance with the following
code
$handler
= new PDO(“mysql:host=127.0.0.1;dbname=database”,
“root”,
“”);
I get the
following error message:
Parse error: syntax error, unexpected ':', expecting ',' or ')' in
/Applications/XAMPP/xamppfiles/htdocs/example/connection.php on line
2
There
has been no problems like this before until I attempted to do this on a new Mac. Can
someone help with this issue?
class="normal">Answer
try
this:
$handler = new
PDO("mysql:host=127.0.0.1;dbname=database",
"root",
"");
your quotes were
wrong
No comments:
Post a Comment