php - User schema for website -


i need create database schema storing user information (id, name, p/w, email address ...etc). have picked arbitrary amounts when sizing these fields. said, have 2 questions:

1) sizes these fields? sure there maximum email address length example...etc.

2) need store user mailing addresses credit card purchases, including international mailing addresses. area not want pick arbitrary sizes.

does know of schema either? there project maybe?

thanks!

also consider db engine use , whether primary key email, rowid, or arbitrary number. typically save passwords on second table called "security" using hash suggested above. here's example.

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 

Comments

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -