UnitedForums - UK Web Hosting Forum UnitedHosting Community Hosting Forums
Network and Server StatusCustomer SupportUK Web Hosting
UnitedHostingUnitedHosting Sitemap UK Hosting ForumUK Web HostingWeb Hosting ForumsUK Reseller HostingWeb Host CommunityUK Managed Dedicated ServersHosting Help and SupportUK Domain Name Registration

Go Back   UnitedForums.co.uk > UnitedHosting Community > Website Development & Scripting

Reply
 
Thread Tools Rate Thread Display Modes
Old 18th October 2007, 04:43 PM   #1 (permalink)
drs2004
Senior Member
 
Join Date: Jul 2004
Posts: 126
Post MySQL problems since upgrade - Password Hahing

Hi,

I'm having problems using the MySQL PASSWORD function since the upgrades. I have read a few articles and I'm still not getting anywhere. I have a website with over 200 users, all of which have hashed passwords.

I reset my own password and notice that the hash is longer than the older passwords, since the upgrade. If I change my password to plain text, and remove the PASSWORD function from the query, I can log in successfully.

I have pasted in the code where the DB is queried.

PHP Code:
// Login query
$query "SELECT user_id, first_name FROM users WHERE username='$u' AND password=PASSWORD('$p')"
PHP Code:
// Set password query
$query "UPDATE users SET password=PASSWORD('$p') WHERE user_id=$uid"
Can you please advise on how I need to query the database since the upgrade to version 4.1.20?

Many thanks,
Daryl
drs2004 is offline   Reply With Quote
Old 18th October 2007, 04:56 PM   #2 (permalink)
Euge
Registered User
 
Euge's Avatar
 
Join Date: Feb 2003
Location: Lost in confusion
Posts: 691
See this:
MySQL AB :: MySQL 5.0 Reference Manual :: 5.7.9 Password Hashing as of MySQL 4.1

I scanned it briefly and saw you might be able to utilize the function OLD_PASSWORD
Euge is offline   Reply With Quote
Old 18th October 2007, 05:04 PM   #3 (permalink)
drs2004
Senior Member
 
Join Date: Jul 2004
Posts: 126
Hi Euege,

Yeah I tried that one last night, no joy!!

Daryl
drs2004 is offline   Reply With Quote
Old 18th October 2007, 06:48 PM   #4 (permalink)
drs2004
Senior Member
 
Join Date: Jul 2004
Posts: 126
hey, I retested with the OLD_PASSWORD function......it works!!!
drs2004 is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


All times are GMT. The time now is 08:03 AM.

UK Web Hosting  |  UK Reseller Hosting  |  UK Dedicated Servers UnitedHosting  |  UnitedSupport  |  UnitedForums  |  SEO by vBSEO 3.0.0
Copyright © 1998-2008 United Communications Limited. All Rights Reserved. Registered in England and Wales 3651923 - VAT Reg No. 737662309