Jump to content

Simlpe question


Minase

Recommended Posts

hy there i am programing in php and sql for some time and till now i was thinking everything i was doing was good

here is a  simple question

i often work with register / login forms

i was thinking of asking you guys if my users table is designed correctly

from my point of view is good,is there any performance "leaks" in it's design? can i structure it in other way for faster results?

thank you

Table Users {
ID (int 20) primary key, auto increment,unique
Username (varchar 14), unique
E-mail(varchar 100), unique
E-mail2(varchar 100), unique
RegisterDate(int 10)
Status(smallint 1)
Lastvisit(int 10)
Idle(int 10)
}

 

Registerdate,lastvisit and Idle are unix timestamps ,status is the account status like 0 = unactivated ,1 activated,2suspended etc

//edit

was thinking about int limit at 2.47 billion is the value 20 too high?

Link to comment
https://forums.phpfreaks.com/topic/184428-simlpe-question/
Share on other sites

The number in the parenthesis for integer type values has no effect on its size.  It is only metadata that applications can be allowed to use to determin how to display it.  A field of type INT is always 4 bytes in size with a maximum number of 4294967295 (unsigned).

Link to comment
https://forums.phpfreaks.com/topic/184428-simlpe-question/#findComment-973632
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.