Results 1 to 3 of 3

Thread: Add extra column after db creation

  1. #1
    Join Date
    Mar 2011
    Location
    N 11 19' 0.0012 E 142 15' 0
    Posts
    1,531
    Thanks
    41
    Thanked 89 Times in 88 Posts
    Blog Entries
    3

    Default Add extra column after db creation

    Lets say I have a db (mysql) that looks like this -

    Code:
    
    Username    Password    DateJoined
    
    Bob         Pass        1/1/2012
    Henry       Pass2       2/4/2012
    Fred        Pass3       8/5/2012
    But want it to look like this

    Code:
    
    Username    Password    DateJoined    LastLogin
    
    Bob         Pass        1/1/2012      Val1
    Henry       Pass2       2/4/2012      Val2
    Fred        Pass3       8/5/2012      Val3

    An example^

    How would you add in the extra column?
    Last edited by keyboard; 04-28-2012 at 02:28 AM.

  2. #2
    Join Date
    Jan 2007
    Location
    Davenport, Iowa
    Posts
    1,742
    Thanks
    82
    Thanked 90 Times in 88 Posts

    Default

    Code:
    ALTER TABLE username ADD LastLogin TEXT NULL;
    To choose the lesser of two evils is still to choose evil. My personal site

  3. The Following User Says Thank You to james438 For This Useful Post:

    keyboard (05-03-2012)

  4. #3
    Join Date
    Mar 2011
    Location
    N 11 19' 0.0012 E 142 15' 0
    Posts
    1,531
    Thanks
    41
    Thanked 89 Times in 88 Posts
    Blog Entries
    3

    Default

    Thanks James

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
  •