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
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
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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.