chery Posted November 19, 2007 Share Posted November 19, 2007 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']; Quote Link to comment Share on other sites More sharing options...
bri0987 Posted November 19, 2007 Share Posted November 19, 2007 You forgot the single quotes... see below $build_array[ ' $value['config_name'] ' ] = $value['config_value']; Quote Link to comment Share on other sites More sharing options...
rajivgonsalves Posted November 19, 2007 Share Posted November 19, 2007 nothing looks wrong with your code but try this $build_array["{$value['config_name']}"] = $value['config_value']; Quote Link to comment Share on other sites More sharing options...
chery Posted November 19, 2007 Author Share Posted November 19, 2007 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 Quote Link to comment Share on other sites More sharing options...
chery Posted November 19, 2007 Author Share Posted November 19, 2007 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 Quote Link to comment Share on other sites More sharing options...
wsantos Posted November 19, 2007 Share Posted November 19, 2007 $sql = "SELECT * FROM FROM phpbb_iNA"; Forgot the qoutes. Quote Link to comment Share on other sites More sharing options...
chery Posted November 19, 2007 Author Share Posted November 19, 2007 $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 Quote Link to comment Share on other sites More sharing options...
chery Posted November 19, 2007 Author Share Posted November 19, 2007 It began throwing these errors when I had to change the original code from $build_array = array(); $sql = "SELECT * FROM " . iNA; to $build_array = array(); $sql = "SELECT * FROM phpbb_iNA; Quote Link to comment Share on other sites More sharing options...
chery Posted November 19, 2007 Author Share Posted November 19, 2007 Changed $sql = "SELECT * FROM phpbb_iNA; To $sql = "SELECT * FROM " . $table_prefix . "ina_data"; and it worked. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.