我正在学习如何使用 mysql 为 android studio 应用程序制作表格的教程 这是创建表的代码
create table users(
id int(11) primary key auto_increment,
unique_id varchar(23) not null unique,
name varchar(50) not null,
email varchar(100) not null unique,
encrypted_password varchar(80) not null,
salt varchar(10) not null,
created_at datetime,
updated_at datetime null
);
但是本教程中的表单只有:
name
email
password
虽然我的表格有:
email
confirm email
name
password
confirm password
referral code
我如何添加确认字段,例如确认密码字段到 mysql 创建表
最佳答案
不要在数据库中添加确认字段,因为它会反对 DRY(不要重复自己)因为如果添加两列包含相同的值会浪费存储空间。您可以在 android 端进行验证。这将是比在数据库中添加字段更好的选择
关于android - 如何在mysql建表中添加确认字段,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44367991/