|
Post by three on Nov 9, 2012 21:34:39 GMT -5
So I have been running around trying to figure out why my login wasn't working. I finally narrowed it down to the fact that my registration function isn't saving my password correctly. I've copied and pasted the same code from HW7, changing the appropriate things of course. Here is my code. $SQLstring = "INSERT INTO $TableName (first, last, userName, password_md5) " . " VALUES( '$firstName', '$lastName', '$userName', '" . md5($password) . "')"; echo $SQLstring; $QueryResult = mysql_query($SQLstring, $DBConnect); if($QueryResult === FALSE) { $msg = 2; ++$errors; }//end of inner if
...for debugging I print the sql string that is being sent to the server. This can be varified with screen shot 1. However when looking in phpmyadmin the password is different (screenshot 2)?? I've tried it different ways, also verified that there are no extra 'quotes' and that my code looks like HW7. The password from screen shot 1 IS correct cuz it's the same password i use for HW7 and it matches, it's just not being stored that way. I'm stumped. Please HELP! ***screenshots are attached*** Attachments:
|
|
|
Post by Bob P on Nov 9, 2012 23:23:14 GMT -5
What is your datatype and what is the length for the field for password_md5? Bob
|
|
|
Post by three on Nov 10, 2012 10:12:23 GMT -5
*** SOLVED *** It was the length. I thought I mimicked HW7 apparently the password variable I shortened. I shouldn't have thought, thinking gets me in trouble. I set it to a way larger number.
Thank you!!
|
|
|
Post by Bob P on Nov 10, 2012 19:40:08 GMT -5
I think 32 char will do it.... Bob
|
|