|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
update query problem
Hello everyone: I am having problem with a query.
In the userPage.cfm I have this: <cfquery name="getUser" datasource = "#mydsn#"> select * from users where name = #Session.UserName# </cfquery> <form action="updateUser.cfm" method="post"> name: <input type="text" name="userName" size="25" value="#getUser.name#"> password: <input type="pass" name = "pass" size="25" value="#getUser.password#"> <input type="submit" value="Update"> </form> ------------------------------------------------------------------- In the updateUser.cfm I have this: <cfif IsDefined("Form.name") and Isdefined("Form.pass")> <cfquery name="updateUser" datasource = "#mydsn#"> update users set name = '#Form.name#', pass = '#Form.pass#' where name = '#Session.userName#' </cfquery> </cfif> ------------------------------------------------------------------- The problem: I have changed the user name in the form and submited it; however, the change was not processed by the updateUser query. That is, the form preserves the old information. Any Idea? Machito |
|
#2
|
|||
|
|||
|
Quote:
You have set up if FORM.name is defined, run the update code. But your form field doesn't have a form field called "name." Instead, it's "userName." Since FORM.name does not exist in the form, it's not defined and that code won't run. At least from first glance. |
|
#3
|
|||
|
|||
|
Yes, your conditional check is looking for a form field that isn't being passed in.
__________________
Ask if you have a question, but also help answer questions that you have knowledge of! Thanks, Brian. How to Post a Question in the Forums |
|
#4
|
|||
|
|||
|
Thank you Bastion and kiteless for the feedback. I have fixed the problem.
Regards, machito |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ColdFusion Development > update query problem |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|