Ibshas25 Posted November 4, 2010 Share Posted November 4, 2010 not sure what the error is Parse error: syntax error, unexpected ';', expecting T_FUNCTION in /export/SOI-50/students/m2009/abhr428/web/WebIbs/User.class.php on line 59 <?php require_once "DataObject.class.php"; class user extends DataObject { protected $data = array( "usr_id" => "", "usr_username" => "", "usr_password" => "", "usr_name" => "", "lastName" => "", "jointime" => "" ); public static function getUsers( $startRow, $numRows, $order ) { $conn = parent::connect(); $sql = "SELECT SQL_CALC_FOUND_ROWS * FROM " . TBL_USERS . " ORDER BY $order LIMIT :startRow, :numRows"; try { $st = $conn->prepare( $sql ); $st->bindValue( ":startRow", $startRow, PDO::PARAM_INT ); $st->bindValue( ":numRows", $numRows, PDO::PARAM_INT ); $st->execute(); $users = array(); foreach ( $st->fetchAll() as $row ) { $users[] = new user( $row ); } $st = $conn->query( "SELECT found_rows() AS totalRows" ); $row = $st->fetch(); parent::disconnect( $conn ); return array( $users, $row["totalRows"] ); } catch ( PDOException $e ) { parent::disconnect( $conn ); die( "Query failed: " . $e->getMessage() ); } } public static function getUser( $id ) { $conn = parent::connect(); $sql = "SELECT * FROM " . TBL_USERS . " WHERE usr_id = :id"; try { $st = $conn->prepare( $sql ); $st->bindValue( ":id", $id, PDO::PARAM_INT ); $st->execute(); $row = $st->fetch(); parent::disconnect( $conn ); if ( $row ) return new User( $row ); } catch ( PDOException $e ) { parent::disconnect( $conn ); die( "Query failed: " . $e->getMessage() ); } } ?> Quote Link to comment https://forums.phpfreaks.com/topic/217752-parse-error-syntax-error-unexpected-expecting-t_function-in/ Share on other sites More sharing options...
Maq Posted November 4, 2010 Share Posted November 4, 2010 You're missing the terminating brace for your class. Quote Link to comment https://forums.phpfreaks.com/topic/217752-parse-error-syntax-error-unexpected-expecting-t_function-in/#findComment-1130290 Share on other sites More sharing options...
Ibshas25 Posted November 4, 2010 Author Share Posted November 4, 2010 im a bit confused... could u post the symbol Quote Link to comment https://forums.phpfreaks.com/topic/217752-parse-error-syntax-error-unexpected-expecting-t_function-in/#findComment-1130294 Share on other sites More sharing options...
Maq Posted November 4, 2010 Share Posted November 4, 2010 im a bit confused... could u post the symbol } at the very end to close your class. Quote Link to comment https://forums.phpfreaks.com/topic/217752-parse-error-syntax-error-unexpected-expecting-t_function-in/#findComment-1130333 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.