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 = ""; } } ?> 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 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 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. 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... 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
Archived
This topic is now archived and is closed to further replies.