Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing Password(Urgent Please)

Status
Not open for further replies.

potinenip

Programmer
Jul 12, 2000
35
0
0
US
Visit site
Hi All,<br>I am trying to write a program to change the User Password information. I am not getting any errore but the password change dosen't work. I mean new password is not updated in the database. Please suggest me if i am wrong with the code. <br><br>&lt;CFQUERY NAME=&quot;GetPassword&quot; DATASOURCE=&quot;PostYourHome&quot;&gt;<br> SELECT Password <br> FROM&nbsp;&nbsp;&nbsp;Sellers<br> WHERE&nbsp;&nbsp;Password='#Password#' and<br> UserName='%#Client.UserName#%'<br>&lt;/CFQUERY&gt;<br><br>&lt;CFIF GetPassword.recordcount EQ 0&gt;<br> <br>&lt;CFQUERY NAME=&quot;DeleteOldPassword&quot; DATASOURCE=&quot;PostYourHome&quot;&gt;<br>&nbsp;&nbsp;&nbsp; Delete From Sellers<br> Where Password = '#Password#' and <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;UserName='%#Client.UserName#%'<br>&lt;/CFQUERY&gt;<br><br>&lt;CFQUERY NAME=&quot;PutNewPassword&quot; DATASOURCE=&quot;PostYourHome&quot;&gt;<br> UPDATE Sellers<br> SET Password = '#NewPassword#'<br> Where UserName='%#Client.UserName#%'<br>&lt;/CFQUERY&gt;<br> <br>&lt;cfoutput&gt; Mr.#Client.UserName# Your Password is Updated. &lt;/cfoutput&gt; <br>&lt;/cfif&gt;<br><br>
 
you are asking if record count eq 0 in the if statement shouldn't it be Not Equal 0<br><br> <p>Dave Joyce<br><a href=mailto:DaveJoyce@hotmail.com>DaveJoyce@hotmail.com</a><br><a href= > </a><br>
 
There is no need to run a DELETE if you are running an UPDATE.&nbsp;&nbsp;Just find the record that you want to update and have it replace the old password with the new password.&nbsp;&nbsp;You are misunderstanding the power of just using the update.&nbsp;&nbsp;also look at davejouce's responce.&nbsp;&nbsp;You are only updating if the record is not there.&nbsp;&nbsp;How are you going to update anything if the recordcount is 0?
 
Hi <br>Thanks for ur replies on the password change thing...<br>I got the password change thing done and I'm breaking my head against a wall on the Editing User Information form.<br>I want to get the record values in the form.<br>I tried both VALUE=&quot;#SellerFirstName#&quot; and VALUE=&quot;#GetUserInfo.SellerFirstName#&quot; <br><br>But still all i get in the form is #GetUserInfo.SellerFirstName# instead of the LastName(Potineni). <br><br>&lt;CFQUERY DATASOURCE=&quot;PostYourHome&quot;&nbsp;&nbsp;NAME=&quot;GetUserInfo&quot;&gt;<br>&nbsp;SELECT *<br>&nbsp;FROM Sellers <br>&nbsp;WHERE UserName = '#Client.UserName#' <br>&lt;/CFQUERY&gt;<br><br>&lt;cfoutput&gt;#GetUserInfo.SellerFirstName#&lt;/cfoutput&gt;<br><br>&lt;CFOUTPUT QUERY=&quot;GetUserInfo&quot;&gt;<br><br>&lt;FONT size=4&gt;Editing the information of &lt;STRONG&gt;#Client.UserName#&lt;/CFOUTPUT&gt;<br>&lt;CFFORM action=&quot;ChangeContactInfoAction.cfm&quot; method=&quot;post&quot;&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&nbsp;&nbsp;<br>&nbsp;&nbsp;<br>&lt;INPUT name=&quot;SellerFirstName&quot; VALUE=&quot;#SellerFirstName#&quot;&nbsp;&nbsp;size=&quot;25&quot;&nbsp;&nbsp;maxlength=&quot;25&quot;&gt;<br><br><br>Please help me with this. <br>Thanks <br>Praveen <br>
 
Hi All,<br>I got the user information update thing this morning. It was simple, i was missing the &lt;cfoutput&gt; tag while displaying &quot;#GetUserInfo.SellerFirstName#&quot;.<br><br>VALUE=&lt;cfoutput&gt;&quot;#GetUserInfo.SellerFirstName#&quot;&lt;/cfoutput&gt;<br><br>Thanks for all the suggestion ya'll gave me.<br>Praveen
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top