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. Quote Link to comment 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] Quote Link to comment 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] Quote Link to comment 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] Quote Link to comment Share on other sites More sharing options...
Seitan Posted December 10, 2006 Author Share Posted December 10, 2006 Sweet thanks, that worked. Quote Link to comment 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? Quote Link to comment Share on other sites More sharing options...
trq Posted December 10, 2006 Share Posted December 10, 2006 Just edit the thread. Quote Link to comment Share on other sites More sharing options...
Seitan Posted December 10, 2006 Author Share Posted December 10, 2006 cool thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.