Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 6 of 6
  1. #1
    Senior Member kleptos's Avatar
    Join Date
    May 2002
    Location
    The Dark Carnival
    Posts
    243
    Member #
    110
    What is the best way to store a password in a MySql database? I thought i was reading somewhere about a password($word) function, but i cant remember. Thanks
    .: Kleptos :.

  2.  

  3. #2
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    MD5('password');

    i.e.:
    Code:
    UPDATE user SET password = MD5('password');
    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!

  4. #3
    Senior Member kleptos's Avatar
    Join Date
    May 2002
    Location
    The Dark Carnival
    Posts
    243
    Member #
    110
    Thats it! Thanks, now how do i get it back out to verify it?
    .: Kleptos :.

  5. #4
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    Same way:
    PHP Code:
    $result mysql_query("SELECT password FROM user WHERE ...");
    // code to get what the query really returned here
    if ($queryresult == md5($passwordtheuserentered))
    {
        echo 
    'You\'re in!';
    }
    else
    {
        echo 
    'Go away!';

    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!

  6. #5
    Senior Member kleptos's Avatar
    Join Date
    May 2002
    Location
    The Dark Carnival
    Posts
    243
    Member #
    110
    What should i set my table column to in order to hold the value?
    .: Kleptos :.

  7. #6
    Senior Member nsr81's Avatar
    Join Date
    Oct 2002
    Posts
    1,132
    Member #
    250
    Liked
    15 times
    since md5 generates a 32 character long string, you can use varchar(32).
    There and Back Again :Ogre:


Remove Ads

Posting Permissions

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

Search tags for this page

password storage mysql

,

web password store mysql

Click on a term to search for related topics.
All times are GMT -6. The time now is 03:02 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com