2012-06-30

simple user table for database

Before, I just see This on my friend facebook and I want to share this!!
♜♞♝♛♚♝♞♜
 
 ♟♟♟♟♟♟♟♟
 
 ♙♙♙♙♙♙♙♙
 
 ♖♘♗♕♔♗♘♖ 
 
now let's talk about the user table. My simple table only have simple like
  • name;
  • password;
  • email;
  • real name;
  • birth;
Other setting would be place on user_detail
for the table, you can copy-paste the code below
user
CREATE TABLE IF NOT EXISTS `tb_user` (
  `u_id` int(11) NOT NULL AUTO_INCREMENT,
  `u_name` varchar(30) NOT NULL,
  `u_pass` varchar(50) NOT NULL,
  `u_mail` varchar(100) NOT NULL,
  PRIMARY KEY (`u_id`),
  UNIQUE KEY `u_name` (`u_name`,`u_pass`,`u_mail`)
)
user-detail
CREATE TABLE IF NOT EXISTS `tb_userdetail` (
  `udet_user` int(11) NOT NULL AUTO_INCREMENT,
  `udet_realname` varchar(50) NOT NULL,
  `udet_birth` date NOT NULL,
  `udet_other` text,
  PRIMARY KEY (`udet_user`)
)
For database engine that not supported autoincrement, I suggest you to read this article!

Tidak ada komentar: