Dakotamay Posted August 30, 2011 Share Posted August 30, 2011 Hello I'm new here. I thank everyone in advance for their help. I'm also new to coding. I've run into this error. Parse error: syntax error, unexpected T_FUNCTION, expecting ')' in /rb.php on line 7806 I've tried a few fixes that I've read and nothing works. I will let everyone know. I am with Ipage hosting. I have heard that it is hard to get scripts to run on their servers. They have php version 5.2.12. I was reading that this particular coding is used in 5.3 and above. I'm completely lost here. If someone could show me how to write this properly. I'd be much appreciative. Here is the code from the file. I have highlighted in red the offending code. I have also included a few other lines to be as helpful as possible. Again thanks in advance for the help. I was also able to include an image. * @return array $results */ public static function exec( $sql, $values=array() ) { return self::secureExec(function($sql, $values')' { return R::$adapter->exec( $sql, $values ); }, NULL, $sql, $values); } /** * Convenience function to execute Queries directly. * Executes SQL. * * @param string $sql sql * @param array $values values * * @return array $results */ public static function getAll( $sql, $values=array() ) { return self::secureExec(function($sql, $values) { return R::$adapter->get( $sql, $values ); }, array(), $sql, $values); } /** * Convenience function to execute Queries directly. * Executes SQL. * * @param string $sql sql * @param array $values values * [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/246071-parse-error-syntax-erro-unexpected-t_function/ Share on other sites More sharing options...
requinix Posted August 31, 2011 Share Posted August 31, 2011 Can you post the complete code without cutting it off at a screenful? Quote Link to comment https://forums.phpfreaks.com/topic/246071-parse-error-syntax-erro-unexpected-t_function/#findComment-1263740 Share on other sites More sharing options...
jcbones Posted August 31, 2011 Share Posted August 31, 2011 Your image and your pasted code doesn't match. Which is true, which isn't. The pasted code will fail to parse. public static function exec( $sql, $values=array() ) { return self::secureExec(function($sql, $values')' { <-HERE, remove the quotes from around the closing argument parenthesis. return R::$adapter->exec( $sql, $values ); }, NULL, $sql, $values); } Quote Link to comment https://forums.phpfreaks.com/topic/246071-parse-error-syntax-erro-unexpected-t_function/#findComment-1263743 Share on other sites More sharing options...
Dakotamay Posted August 31, 2011 Author Share Posted August 31, 2011 Hi Thanks for the replies thus far. The image is the actual code. Here is the full code. I have added it as a text file as it is over the 40000 allowable for posts. [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/246071-parse-error-syntax-erro-unexpected-t_function/#findComment-1263752 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.