Ibshas25 Posted November 1, 2010 Share Posted November 1, 2010 i keep getting the above error.. help this is a class of the log entry <?php require_once "config.php"; abstract class DataObject { protected $data = array(); public function__construct( $data ) { foreach ( $data as $key => $value ) { if ( array_key_exists( $key, $this->data )) $this->data[$key] = $value; } } public function getValue( $field ) { if ( array_key_exists( $field, $this->data )) { return $this->data[$field]; } else { die( "field not found" ); } } public function getValueEncoded( $field ) { return htmlspecialchars( $this->getValue( $field )); } protected function connect() { try { $conn = new PDO(DB_DSN, DB_USERNAME, DB_PASSWORD ); $Conn->setAttribute( PDO::ATTR_PERSISTENT, true ); $conn->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION ); } catch ( PDOException $e->getMessage() ); die( "connection failed: " . $e->getMessage() ); } return $conn; } protected function disconnect( $conn ) { $conn = ""; } } ?> Quote Link to comment https://forums.phpfreaks.com/topic/217465-parse-error-syntax-error-unexpected-t_object_operator-in-exportsoi-50studen/ Share on other sites More sharing options...
salathe Posted November 1, 2010 Share Posted November 1, 2010 } catch ( PDOException $e->getMessage() ); Should be: } catch ( PDOException $e) { More info: http://php.net/catch Quote Link to comment https://forums.phpfreaks.com/topic/217465-parse-error-syntax-error-unexpected-t_object_operator-in-exportsoi-50studen/#findComment-1129034 Share on other sites More sharing options...
Ibshas25 Posted November 1, 2010 Author Share Posted November 1, 2010 thanks that was another problem the actual error was this.... Parse error: syntax error, unexpected T_STRING, expecting T_VARIABLE in /export/SOI-50/students/m2009/abhr428/web/WebIbs/DataObject.class.php on line 9 Quote Link to comment https://forums.phpfreaks.com/topic/217465-parse-error-syntax-error-unexpected-t_object_operator-in-exportsoi-50studen/#findComment-1129038 Share on other sites More sharing options...
PFMaBiSmAd Posted November 1, 2010 Share Posted November 1, 2010 You don't have any white-space after the function keyword. Quote Link to comment https://forums.phpfreaks.com/topic/217465-parse-error-syntax-error-unexpected-t_object_operator-in-exportsoi-50studen/#findComment-1129040 Share on other sites More sharing options...
Ibshas25 Posted November 1, 2010 Author Share Posted November 1, 2010 thanks for pointing that out but im still getting the same error... Quote Link to comment https://forums.phpfreaks.com/topic/217465-parse-error-syntax-error-unexpected-t_object_operator-in-exportsoi-50studen/#findComment-1129043 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.