Custom layout for website

I need to create a database schema to store user information (id, name, p / w, email address ... etc.). When choosing these fields, I always chose arbitrary amounts. With this in mind, I have two questions:

1) What are the good sizes for these fields? I am sure that there is a maximum length of an email address, for example ... etc.

2) Now I need to save the mailing addresses of users for purchases of credit cards, including international mailing addresses. This is an area in which I do not want to select arbitrary sizes.

Does anyone know of a good circuit? Is a project possible for this?

Thank!

+3
source share
3 answers

1. , MySQL, - , - .

`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`username` varchar(255),
`email` varchar(255),
`password` char(256)

, 256- varchar. , . "" . , , .

+1

, db- , , rowid . , "", , . .

CREATE TABLE IF NOT EXISTS `users` (
  `user_id` varchar(255) NOT NULL,
  `active` char(1) default 'Y',
  `created_date` INTEGER UNSIGNED default 0,
  `email` varchar(255) default NULL,
  `first_name` varchar(255) default NULL,
  `last_name` varchar(255) default NULL,
  `modified_date` INTEGER UNSIGNED default 0,
  PRIMARY KEY  (`user_id`, `active`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8
+1

, , , , "" , , IETF.

- 256 , ( 254 ). Dominic Sayers.

?

, , , - 72 . , 100 , .

, 100% , , (, /). , - - - , - , .

, , NoSQL - , , , MongoDB CouchDB, , , , , .

0
source

Source: https://habr.com/ru/post/1767229/


All Articles