1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
|
public function createOne( $role ) {
$query =
"INSERT INTO member (
id
,username
,firstName
,lastName
,phone
,startDate
)
VALUES (
'".$role->id."'
,'".$role->username."'
,'".$role->firstName."'
,'".$role->lastName."'
,'".$role->phone."'
,".date("Y-m-d",$role->startDate/1000)."
);";
if( mysql_query( $query, $this->dbConn ) ) {
$lastInsertId = null;
$lastInsertId = mysql_insert_id( $this->dbConn );
$role->id = $lastInsertId;
$tmparr = array();
array_push( $tmparr, $role );
array_push( MemberDao::$loaded, $role );
$this->addFKeysToObjects( $tmparr );
return( $role );
}
else {
return mysql_error();
}
} |