Parse error: syntax error, Unexpected '=>' (T_DOUBLE_ARROW), expecting ',' or ')' fucks local, but not on the Server

Asked

Viewed 188 times

0

Good morning,

The code below works local, but when upei gave the following error

Parse error: syntax error, unexpected '=>' (T_DOUBLE_ARROW), expecting ',' or ')' in D:\Inetpub\vhosts\....."caminho do arquivo)

Error code:

$conn = getConnection();
$stmt = $conn->prepare('SELECT senha, usuario FROM usuario where usuario.usuario = :cnpj');
$stmt->execute(['cnpj' => $cnpj]);
$resultado = $stmt->fetch();
$usuario = $resultado['usuario'];
$senha = $resultado['senha'];
  • 3

    Do you use php5.3? which version is?

  • 1

    I believe that that explain the problem.

  • In hosweb is 5.3, on my machine the 7. update to which version on the host and if you can not update how I can fix all "=>" without changing much in the code?

  • The ideal is to change the version of php, the 5.3 was released in 2009 ... almost 10 ago. in case you can not change the ['cnpj' => 'valor'] for array('cnpj' => 'valor);

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.