Failing to insert binary(md5()) password
Posted 29 September 2006 - 10:50 AM
INSERT INTO Users (FirstName, LastName, Usrname, Passwrd, AccessLevel, last_login, UserID)
VALUES ('Alf', 'Stockton', 'alf',0xd8cc7e40d17aaefd27cd324f7ba91079, '9', '2006/09/29 12:05:23', '0')
However this fails and I am not sure why.
BTW The value starting 0xd8....... is the password converted via md5()
Please tell me what I got wrong.
Alf Stockton Programmer for rent.
Posted 01 October 2006 - 10:32 PM
If you want to use a field, as the other poster said, use binary(16), or image.
Posted 03 October 2006 - 12:02 PM
mixed *mssql_query* ( string query [, resource link_identifier [, int
Returns: A MS SQL result resource on success, *TRUE* if no rows were
returned, or *FALSE* on error.
and my code reads:-
$passwd = ""; // for debugging only
$insert = sprintf("INSERT INTO Users (FirstName, LastName, Usrname,
Passwrd, AccessLevel, last_login, UserID)
VALUES ('%s', '%s', '%s', '%s', '%d', '%s', '%d')",
$FirstName, $Surname, $uname, $passwd,
$accesslevel, $regdate, $_SESSION['UID']);
$Reply = mssql_query($insert, $link);
if ($Reply == FALSE)
$Message = sprintf("%s %d <br>Record not inserted. Please refer
problem to Admin.", __FILE__, __LINE__);
trigger_error($Message, E_USER_ERROR, $link);
Maybe on an insert, no rows would be returned and therefore I possibly
should be checking for something other than "if ($Reply == FALSE)"?
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users