PHP Login System with Admin Features

This forum was created to talk about the PHP Login System with admin features created by jpmaster77 on evolt's website


    How to change the primary key of the user table

    Share
    avatar
    s.w.vanderlaan

    Number of posts : 19
    Age : 38
    Localisation : The Netherlands
    Registration date : 2009-03-22

    How to change the primary key of the user table

    Post  s.w.vanderlaan on Fri Apr 03, 2009 2:17 am

    Hi,

    I was wondering if anyone can help me with changing the primary key to something else. I am not that fond of the username being the primary key. I want to change it to some random number.

    Kind regards,

    Sander
    avatar
    Linchpin311

    Number of posts : 220
    Age : 32
    Localisation : Long Island
    Registration date : 2007-05-14

    Re: How to change the primary key of the user table

    Post  Linchpin311 on Mon Apr 06, 2009 5:05 pm

    really your best bet is sticking with the username as the primary key for a couple of reasons... i dont know why you would want to change it, but if you heart is really set on it you could hash the username and save that. the odds of two different usernames generating identical hashes are like 0.001% but the odds of two different usernames being identical will always be 0%


    _________________
    in the end, the universe tends to unfold as it should...

    Also note that it is your responsibility to die() if necessary.
    avatar
    s.w.vanderlaan

    Number of posts : 19
    Age : 38
    Localisation : The Netherlands
    Registration date : 2009-03-22

    Re: How to change the primary key of the user table

    Post  s.w.vanderlaan on Fri Apr 10, 2009 6:21 am


    really your best bet is sticking with the username as the primary key for a couple of reasons... i dont know why you would want to change it, but if you heart is really set on it you could hash the username and save that. the odds of two different usernames generating identical hashes are like 0.001% but the odds of two different usernames being identical will always be 0%

    Hi,

    I read in another post some solutions/answers to this question. But hashing the username is a good idea.

    Thanks!

    Sander

    Sponsored content

    Re: How to change the primary key of the user table

    Post  Sponsored content


      Current date/time is Mon Dec 11, 2017 7:00 pm