phpwampphped

Why i am getting error in Nusphere PHPed?


I am getting this error

Parse error: syntax error, unexpected T_DOUBLE_ARROW, expecting '(' in C:\wamp\www\common.php on line 15

and the line 15 is

$options = array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8'); 

but when i run in wamp then it's run fine without any error. so...


Solution

  • The PDO::MYSQL_ATTR_INIT_COMMAND constant is only available when the mysqlnd driver is used. I guess Nysphere doesn't have that driver enabled.

    See https://bugs.php.net/bug.php?id=47224

    Also search SO for other questions related to MYSQL_ATTR_INIT_COMMAND