Example #1
0
 public function insert()
 {
     $Demo = new Model('Demo');
     // 实例化模型类
     $Demo->Create();
     // 创建数据对象
     $result = $Demo->add();
     // 写入数据库
     $this->redirect('index');
     // 成功后重定向到index操作页面
 }
Example #2
0
 public function insert()
 {
     //定义方法
     $ins = new Model('user');
     // 实例化模型类,传递参数为没有前缀的数据表名称
     $ins->Create();
     // 创建数据对象
     $result = $ins->add();
     // 写入数据库
     $this->redirect('Index/index', '', 5, '页面跳转中');
     //页面重定向
 }
Example #3
0
 /**
  * PDO::Create
  * @return Create
  */
 public static function pdoCreate()
 {
     return self::$Create ? self::$Create : (self::$Create = new Create());
 }
Example #4
0
 public function insert()
 {
     $ins = new Model('user');
     $ins->Create();
     $result = $ins->add();
 }
Example #5
0
 /**
  * 插入数据库的日志
  * @see Ilog::DataLog()
  */
 public static function DataLog($content, $tag = NULL, $rank = 0)
 {
     $Log = new Model();
     $Log->TableName = __TaPr__ . "log";
     return $Log->Create(array("LogTitle" => date("Y-m-d H:i:s") . "发生了一条日志 ", "LogContent" => $content, "LogAddTime" => times(), "LogAddRank" => (int) $tag));
 }