Advanced Search

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,430
    Thanks
    37
    Thanked 84 Times in 83 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 keyboard1333; 04-28-2012 at 01:28 AM.
    keebs - keyboard1333 [at] gmail [dot] com
    My Website | Anime Views Forums

  2. #2
    Join Date
    Jan 2007
    Location
    Davenport, Iowa
    Posts
    1,609
    Thanks
    73
    Thanked 81 Times in 79 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:

    keyboard1333 (05-03-2012)

  4. #3
    Join Date
    Mar 2011
    Location
    N 11° 19' 0.0012 E 142° 15' 0
    Posts
    1,430
    Thanks
    37
    Thanked 84 Times in 83 Posts
    Blog Entries
    3

    Default

    Thanks James
    keebs - keyboard1333 [at] gmail [dot] com
    My Website | Anime Views Forums

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
  •