Viewing file: da_umuser.php (2.35 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
include_once("ver_model.php");
class Da_umuser extends Ver_model { // PK is UsID public $UsID; public $UsName; public $UsLogin; public $UsPassword; public $UsPsCode; public $UsWgID; public $UsQsID; public $UsAnswer; public $UsEmail; public $UsActive; public $UsAdmin; public $UsDesc; public $UsPwdExpDt; public $UsUpdDt; public $UsUpdUsID; public $UsSessionID;
public $last_insert_id;
function __construct() { parent::__construct(); } function insert() { // if there is no auto_increment field, please remove it $sql = "INSERT INTO ".$this->ums_db.".umuser (UsID, UsName, UsLogin, UsPassword, UsPsCode, UsWgID, UsQsID, UsAnswer, UsEmail, UsActive, UsAdmin, UsDesc, UsPwdExpDt, UsUpdDt, UsUpdUsID, UsSessionID) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"; $this->db->query($sql, array($this->UsID, $this->UsName, $this->UsLogin, $this->UsPassword, $this->UsPsCode, $this->UsWgID, $this->UsQsID, $this->UsAnswer, $this->UsEmail, $this->UsActive, $this->UsAdmin, $this->UsDesc, $this->UsPwdExpDt, $this->UsUpdDt, $this->UsUpdUsID, $this->UsSessionID)); $this->last_insert_id = $this->db->insert_id(); } function update() { // if there is no primary key, please remove WHERE clause. $sql = "UPDATE ".$this->ums_db.".umuser SET UsName=?, UsLogin=?, UsPassword=?, UsPsCode=?, UsWgID=?, UsQsID=?, UsAnswer=?, UsEmail=?, UsActive=?, UsAdmin=?, UsDesc=?, UsPwdExpDt=?, UsUpdDt=?, UsUpdUsID=?, UsSessionID=? WHERE UsID=?"; $this->db->query($sql, array($this->UsName, $this->UsLogin, $this->UsPassword, $this->UsPsCode, $this->UsWgID, $this->UsQsID, $this->UsAnswer, $this->UsEmail, $this->UsActive, $this->UsAdmin, $this->UsDesc, $this->UsPwdExpDt, $this->UsUpdDt, $this->UsUpdUsID, $this->UsSessionID, $this->UsID)); } function delete() { // if there is no primary key, please remove WHERE clause. $sql = "DELETE FROM ".$this->ums_db.".umuser WHERE UsID=?"; $this->db->query($sql, array($this->UsID)); } /* * You have to assign primary key value before call this function. */ function get_by_key($withSetAttributeValue=FALSE) { $sql = "SELECT * FROM ".$this->ums_db.".umuser WHERE UsID=?"; $query = $this->db->query($sql, array($this->UsID)); if ( $withSetAttributeValue ) { $this->row2attribute( $query->row() ); } else { return $query ; } } } //=== end class Da_umuser ?>
|