SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Wizard lorenw's Avatar
    Join Date
    Feb 2005
    Location
    was rainy Oregon now sunny Florida
    Posts
    1,104
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    mysql PASSWORD may not be working??

    Hi,

    I have a login that is not working on a clients sever.

    PHP Code:
    // doesn't work
    $sql '
        SELECT *
        FROM microcms_administrators
        WHERE administrators_username = "' 
    $_POST['administrators_username'] . '" and
            administrators_pass = PASSWORD("' 
    $_POST['administrators_pass'] . '")';

    // works
    $sql '
        SELECT *
        FROM microcms_administrators
        WHERE administrators_username = "' 
    $_POST['administrators_username'] . '"'
    The one that doesn't work actually works on my local host and my production server.

    My clients server people say it is a problem in my script and they dont debug scripts, end of discussion (so far). And all error reporting is turned off on their server (You can mis spell the table name or any SELECT FROM item and there are no errors).

    My question, is there any way to echo out the PASSWORD("' . $_POST['administrators_pass'] . '") value to see if it is blank or returning some value that I am not expecting. This way I can either correct it on my level or point it out to the server people.

    I also ran this and the password syntax may be wrong

    PHP Code:
    INSERT INTO 
        microcms_administrators 
        SET
    administrators_name 
    ='admin'
    administrators_username ='admin',
    administrators_pass ="PASSWORD( 'admin' )"
    administrators_email 'admin@admin.com' 
    and it puts PASSWORD( 'admin' ) into the table


    Thanks for any help

    cheers
    Loren

    Edit:

    I just ran

    PHP Code:
    INSERT INTO 
        microcms_administrators 
        SET
    administrators_name 
    ='admin'
    administrators_username ='admin',
    administrators_pass PASSWORD'admin' ), 
    administrators_email 'admin@admin.com' 
    and in my clients db it put
    43e9a4ab75570f5b
    which is totally wrong and probably OLD_PASSWORD style

    the value should be (with the *)
    *4ACFE3202A5FF5CF467898FC58AAB1D615029441

    their sql version is 4.1.2 so it should support PASSWORD and did read the nysql documentation that says that there may be these type of isues with upgraded versions.

    I think I answered my question
    Last edited by lorenw; Aug 22, 2007 at 15:20. Reason: ran another check

  2. #2
    SitePoint Zealot detzX's Avatar
    Join Date
    Oct 2006
    Posts
    135
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I never use password, i've always had issues. If you can just change it to md5 or something, or use a php function to encrypt the password.
    www.invoicejournal.com - Invoice clients for Free


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
  •