-1

I am having a hard time working on this one. The shared server uses PHP 5.4 and returns and error.

I am using a tester that returns :

FATAL ERROR syntax error, unexpected '[' on line number 3

<?php
// This is the database connection configuration.
return [
    'connectionString' => 'mysql:host=localhost;dbname=languag2_lp',
    'emulatePrepare' => true,  
    'username' => 'languag2_lp',
    'password' => 'languag2_lp',
    'charset' => 'utf8',
    'tablePrefix' => 'tbl_',
];

any ideas please.. thanks!

m02ph3u5
  • 3,022
  • 7
  • 38
  • 51
jaycee
  • 1
  • 1

2 Answers2

0

you can use this code:

return array(
    'connectionString' => 'mysql:host=localhost;dbname=languag2_lp',    
    'emulatePrepare' => true,
    'username' => 'languag2_lp',  'password' => 'languag2_lp',
    'charset' => 'utf8',
    'tablePrefix' => 'tbl_',
);
Abed Alzain
  • 749
  • 4
  • 9
0

In PHP 5.4 ,started supporting short style for array . Like as

<?php
$myArray = array(1,2,3,4);

 //or

 $myArray = [1,2,3,4];

May be your tested would be uses some lower version . Check the following code

<?php

return array(
'connectionString' => 'mysql:host=localhost;dbname=languag2_lp',
'emulatePrepare' => true,
'username' => 'languag2_lp', 'password' => 'languag2_lp',
'charset' => 'utf8',
'tablePrefix' => 'tbl_');

One more thing that after

'tablePrefix' => 'tbl_',

there should be no comma like this.

'tablePrefix' => 'tbl_'
Deepak Dixit
  • 1,510
  • 15
  • 24