Jump to content

[SOLVED] syntax error


chery

Recommended Posts

Parse error: syntax error, unexpected '[', expecting ']' in /home/worldwid/public_html/admin/admin_arcade.php on line 47

Can anyone see the error and how to fix it?

 

//
//        Load DB
//
  $build_array = array();
  $sql = "SELECT * FROM FROM phpbb_iNA;
         $result = $db->sql_query($sql);
         $ina_info = $db->sql_fetchrowset($result);
  foreach ($ina_info as $key => $value)
  {
    $build_array[$value['config_name']]  = $value['config_value'];
  }     
        unset($ina_info);
         $arcade_config = $build_array;
//

line 47 is

$build_array[$value['config_name']]  = $value['config_value'];
Link to comment
https://forums.phpfreaks.com/topic/77889-solved-syntax-error/
Share on other sites

 

You forgot the single quotes...

 

see below

 

 

$build_array[ ' $value['config_name'] ' ]  =  $value['config_value'];

Your suggestion gave this error:

Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/worldwid/public_html/admin/admin_arcade.php on line 47

Link to comment
https://forums.phpfreaks.com/topic/77889-solved-syntax-error/#findComment-394258
Share on other sites

nothing looks wrong with your code but try this

 

$build_array["{$value['config_name']}"]  = $value['config_value'];

Your suggestion gave this error:

Parse error: syntax error, unexpected '"', expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/worldwid/public_html/admin/admin_arcade.php on line 47

Link to comment
https://forums.phpfreaks.com/topic/77889-solved-syntax-error/#findComment-394261
Share on other sites

$sql = "SELECT * FROM FROM phpbb_iNA";

 

Forgot the qoutes.

Warning: Invalid argument supplied for foreach() in /home/worldwid/public_html/admin/admin_arcade.php on line 45

 

Parse error: syntax error, unexpected '[', expecting ']' in /home/worldwid/public_html/admin/admin_arcade_log.php on line 37

Link to comment
https://forums.phpfreaks.com/topic/77889-solved-syntax-error/#findComment-394267
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.