【问题标题】:What is the difference between users and user_profiles tables in Tank auth (CodeIgniter library)?Tank auth(CodeIgniter 库)中的 users 和 user_profiles 表有什么区别?
【发布时间】:2016-10-04 19:20:20
【问题描述】:

我整天都在浏览 Tank auth 库并取得了一些成功,但我无法理解在数据库中创建的 user_profiles 表。

CREATE TABLE IF NOT EXISTS `user_profiles` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `country` varchar(20) COLLATE utf8_bin DEFAULT NULL,
  `website` varchar(255) COLLATE utf8_bin DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

我试图用谷歌搜索它,但没有取得巨大成功......有关于用户帐户与用户配置文件的文章,但没有关于它在数据库级别如何工作的信息。

我已经设法根据我的需要调整库 - 现在注册的用户需要输入家庭地址,并且它保存在用户表的数据库中。但现在我怀疑自己是否将其保存在 user_profiles 下以供以后使用。

那么问题 - user_profiles 表的原因是什么,我应该如何使用它?

【问题讨论】:

    标签: mysql database codeigniter user-profile tankauth


    【解决方案1】:

    使用users 表存储User 对象信息,即user_idpassword 等...

    使用users_profiles 表存储有关User 对象的信息,即地址信息

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-01-01
      • 1970-01-01
      • 2018-06-23
      • 1970-01-01
      • 2017-03-17
      • 1970-01-01
      相关资源
      最近更新 更多