Jump to content

Parse error: syntax error, unexpected ')' in /expor


Recommended Posts

 

not sure on this one... seems like somethings missing

 

 

 

try {

$st = $conn->prepare( $sql );

$st->bindValue( ":username", $this->data["username"], PDO::PARAM_STR );

$st->bindValue( ":firstname", $this->data["firstName"], PDO::PARAM_STR );

$st->bindValue( ":lastName", $this->data["lastName"], PDO::PARAM_STR );

$st->bindValue( ":password", $this->data["password"], PDO::PARAM_STR );

$st->bindValue( ":joinTime", $this->data["joinTime"], PDO::PARAM_STR );

 

 

PDO::PARAM_STR );

$st->execute();

parent::disconnect( $conn );

} catch ( PDOException $e ) {

parent::disconnect( $conn );

die( "Query failed: " . $e->getMessage() );

 

}

 

}

 

 

?>

<?php

 

require_once "DataObject.class.php";

 

class users extends DataObject {

 

protected $data = array(

"usr_id" => "",

"usr_username" => "",

"usr_name" => "",

"usr_surname" => "",

"usr_password" => "",

"usr_issysadmin" => "",

"usr_isuseractive" => "",

"usr_lastlogintime" => "",

"usr_recorduserid" => "",

"usr_recordtime" => "",

 

);

 

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::discount( $conn );

die( "Query Failed: " . $e->getMessage() );

}

}

 

public static function getBYUsername( $username ) {

$conn = parent::connect();

$sql = " SELECT * FROM " . TBL_users . "WHERE usr_username = :username";

 

try {

$st = $conn->prepare( $sql );

$st->bindValue( ":username", $username, PDO::PARAM_STR );

$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() );

 

}

}

 

public function insert() {

$conn = parent::connect();

$sql = "INSERT INTO " .TBL_users . " (

usr_username,

usr_name,

usr_surname,

usr_password,

usr_recordtime

) Values (

:username,

:firstname,

:lastName,

password(:password),

:joinTime

)";

 

try {

$st = $conn->prepare( $sql );

$st->bindValue( ":username", $this->data["username"], PDO::PARAM_STR );

$st->bindValue( ":firstname", $this->data["firstName"], PDO::PARAM_STR );

$st->bindValue( ":lastName", $this->data["lastName"], PDO::PARAM_STR );

$st->bindValue( ":password", $this->data["password"], PDO::PARAM_STR );

$st->bindValue( ":joinTime", $this->data["joinTime"], PDO::PARAM_STR );

 

 

PDO::PARAM_STR );

$st->execute();

parent::disconnect( $conn );

} catch ( PDOException $e ) {

parent::disconnect( $conn );

die( "Query failed: " . $e->getMessage() );

 

}

 

}

 

 

?>

 

it was giving the error at line 108 at the start of

 

PDO::PARAM_STR ;

        $st->execute();

        parent::disconnect( $conn );

      }    catch ( PDOException $e ) {

        parent::disconnect( $conn );

        die( "Query failed: " . $e->getMessage() );

       

        }     

 

}

 

 

i took that bracket out but now its gives this

 

Parse error: syntax error, unexpected ';', expecting T_FUNCTION in /export/SOI-50/students/m2009/abhr428/web/WebIbs/users.class.php on line 120

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.