SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Wizard DoubleDee's Avatar
    Join Date
    Aug 2010
    Location
    Arizona
    Posts
    3,764
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    How big should E-mail be?

    How big should I make my E-mail field?

    Right now I have 40 characters, but maybe that is too small??


    Debbie

  2. #2
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,813
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    An email address is allowed to have up to 255 characters before the @ and up to 63 characters after so the absolute maximum length it can have is 319. I generally use a varchar (255) to hold email addresses as that only uses as much space as the address actually needs and I have never come across an email address longer than that.

    The only difference between a char(40) and varchar(255) is that email addresses longer than 40 will not fit into the first of these - a smaller email address will take up the same amount of space in both since the char(40) will almost certainly be converted by the database itself into a varchar so as to save space.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •