SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot bloo_fish's Avatar
    Join Date
    Aug 2003
    Location
    Bucks [Uk]
    Posts
    127
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    MySQL pass=PASSWORD('') prob

    Ok, i have created a table (users) with the follwoing structure

    Code:
    CREATE TABLE users (
     id int not null primary key auto_increment,
     username varchar(25) UNIQUE NOT NULL,
     password char(16) NOT NULL,
    
     fname varchar(100) NOT NULL,
     surname varchar(100) NOT NULL
    );
    note the password field is char(16). I now store a pass in this using

    password=PASSWORD('mypass')

    which stores an encrypted version. All ok so far (i think) but when i use

    select * from users where password=PASSWORD('mypass') i recieve nothing

    well to be precise i recieve an empty set (no error messages)

    edit: i should probbably say that this use to work fine, but i have recently upgraded mysql and am now using mysql-4.1.9-win32 (cant remeber what i had before) and this is on win xp sp2.

    Thanks for any help

  2. #2
    SitePoint Wizard stereofrog's Avatar
    Join Date
    Apr 2004
    Location
    germany
    Posts
    4,324
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    In version 4.1. mysql team decided to change the way how PASSWORD works. Details

    PS. That's why I never use PASSWORD and make all hashing at application level.

  3. #3
    SitePoint Zealot bloo_fish's Avatar
    Join Date
    Aug 2003
    Location
    Bucks [Uk]
    Posts
    127
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the link, will read in a mo.

    Looks like i will have to do something in php then.


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
  •