Seitan Posted December 10, 2006 Share Posted December 10, 2006 Hey, I'm trying to put together a change password thing, and I keep getting a problem with it. Here is the error.[quote]Notice: Query: UPDATE `users` SET `password` = SHA('?), `active` = NULL WHERE `user_name` = somenameMySQL Error: Unknown column 'somename' in 'where clause' in /homepages/29/d178597021/htdocs/php/change_password.php on line 50[/quote]Here is my SQL statement [code]"UPDATE `users` SET `password` = SHA('$p'), `active` = NULL WHERE `user_name` = {$_SESSION['user_name']}";[/code]The thing is, that there [b]is [/b]a record with the user_name somename. So I don't get with it. I've tried some variations, like changing it to user_id, but that doesn't work either. Link to comment https://forums.phpfreaks.com/topic/30087-resolved-change-password-problem/ Share on other sites More sharing options...
fert Posted December 10, 2006 Share Posted December 10, 2006 change[code]"UPDATE `users` SET `password` = SHA('$p'), `active` = NULL WHERE `user_name` = {$_SESSION['user_name']}";[/code]to[code]"UPDATE `users` SET `password` = SHA('$p'), `active` = NULL WHERE `user_name` = '$_SESSION['user_name']'";[/code] Link to comment https://forums.phpfreaks.com/topic/30087-resolved-change-password-problem/#findComment-138303 Share on other sites More sharing options...
Seitan Posted December 10, 2006 Author Share Posted December 10, 2006 no that didn't work, I just got this instead[quote]Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /homepages/29/d178597021/htdocs/php/change_password.php on line 49[/quote] Link to comment https://forums.phpfreaks.com/topic/30087-resolved-change-password-problem/#findComment-138304 Share on other sites More sharing options...
fert Posted December 10, 2006 Share Posted December 10, 2006 then change[code]"UPDATE `users` SET `password` = SHA('$p'), `active` = NULL WHERE `user_name` = '$_SESSION['user_name']'";[/code]to[code]"UPDATE `users` SET `password` = SHA('$p'), `active` = NULL WHERE `user_name` = '{$_SESSION['user_name']}'";[/code] Link to comment https://forums.phpfreaks.com/topic/30087-resolved-change-password-problem/#findComment-138305 Share on other sites More sharing options...
Seitan Posted December 10, 2006 Author Share Posted December 10, 2006 Sweet thanks, that worked. Link to comment https://forums.phpfreaks.com/topic/30087-resolved-change-password-problem/#findComment-138311 Share on other sites More sharing options...
Seitan Posted December 10, 2006 Author Share Posted December 10, 2006 by the way, how do I marked this resolved, do I just edit it and add [resolved] or is there a button or link? Link to comment https://forums.phpfreaks.com/topic/30087-resolved-change-password-problem/#findComment-138312 Share on other sites More sharing options...
trq Posted December 10, 2006 Share Posted December 10, 2006 Just edit the thread. Link to comment https://forums.phpfreaks.com/topic/30087-resolved-change-password-problem/#findComment-138313 Share on other sites More sharing options...
Seitan Posted December 10, 2006 Author Share Posted December 10, 2006 cool thanks Link to comment https://forums.phpfreaks.com/topic/30087-resolved-change-password-problem/#findComment-138314 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.