why doen't sql delete work if it is followed with a cflocation tag
Hello everybody, I have a form with a cancel button. When the user hits the cancel button, I want to perform a sql delete.. immediately after that I want to redirect the user. Here is the code: cfif isDefined(form.CANCELLOCK) and form.CANCELLOCK eq 1 cfquery datasource=db name=qDel delete from table1 where lvalue ='12345' /cfquery cfoutput cflocation url=""> addtoken=no /cfoutput /cfif When I run this code and hit the 'cancel' button... the sql delete does not delete the row from the table. However if I remove the cflocation tag from the code and run it again, it deleted the row from the table. I'm not able to figure out why it is doing this. Can anybody help please Best regards, cfcoder __ Do you Yahoo!? New and Improved Yahoo! Mail - Send 10MB messages! http://promotions.yahoo.com/new_mail [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
Re: why doen't sql delete work if it is followed with a cflocation tag
Are you looking directly into the database to see if data was deleted or not? - Original Message - From: cf coder To: CF-Talk Sent: Wednesday, June 16, 2004 10:18 AM Subject: why doen't sql delete work if it is followed with a cflocation tag Hello everybody, I have a form with a cancel button. When the user hits the cancel button, I want to perform a sql delete.. immediately after that I want to redirect the user. Here is the code: cfif isDefined(form.CANCELLOCK) and form.CANCELLOCK eq 1 cfquery datasource=db name=qDel delete from table1 where lvalue ='12345' /cfquery cfoutput cflocation url=""> addtoken=no /cfoutput /cfif When I run this code and hit the 'cancel' button... the sql delete does not delete the row from the table. However if I remove the cflocation tag from the code and run it again, it deleted the row from the table. I'm not able to figure out why it is doing this. Can anybody help please Best regards, cfcoder __ Do you Yahoo!? New and Improved Yahoo! Mail - Send 10MB messages! http://promotions.yahoo.com/new_mail [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
RE: why doen't sql delete work if it is followed with a cflocation tag
Just a comment, but you don't need the cfoutput around the cflocation John -Original Message- From: brobborb [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 16, 2004 11:16 AM To: CF-Talk Subject: Re: why doen't sql delete work if it is followed with a cflocation tag Are you looking directly into the database to see if data was deleted or not? - Original Message - From: cf coder To: CF-Talk Sent: Wednesday, June 16, 2004 10:18 AM Subject: why doen't sql delete work if it is followed with a cflocation tag Hello everybody, I have a form with a cancel button. When the user hits the cancel button, I want to perform a sql delete.. immediately after that I want to redirect the user. Here is the code: cfif isDefined(form.CANCELLOCK) and form.CANCELLOCK eq 1 cfquery datasource=db name=qDel delete from table1 where lvalue ='12345' /cfquery cfoutput cflocation url=""> addtoken=no /cfoutput /cfif When I run this code and hit the 'cancel' button... the sql delete does not delete the row from the table. However if I remove the cflocation tag from the code and run it again, it deleted the row from the table. I'm not able to figure out why it is doing this. Can anybody help please Best regards, cfcoder __ Do you Yahoo!? New and Improved Yahoo! Mail - Send 10MB messages! http://promotions.yahoo.com/new_mail [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
Re: why doen't sql delete work if it is followed with a cflocation tag
yes I am. If I run the query in sql analyser it deletes the row. [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
Re: why doen't sql delete work if it is followed with a cflocation tag
no, I dont meant running the SQL code to see if it works.I meant, after running the CFM page witht he CFLOCATION intact, how do u heck to see if the data was deleted or not?Do you look directly into the database?Or does it tell you on the processing page? - Original Message - From: cf coder To: CF-Talk Sent: Wednesday, June 16, 2004 10:35 AM Subject: Re: why doen't sql delete work if it is followed with a cflocation tag yes I am. If I run the query in sql analyser it deletes the row. [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
Re: why doen't sql delete work if it is followed with a cflocation tag
After running the cfm page, I'm check in the database table to see if the record is deleted no, I dont meant running the SQL code to see if it works.I meant, after running the CFM page witht he CFLOCATION intact, how do u heck to see if the data was deleted or not?Do you look directly into the database?Or does it tell you on the processing page? - Original Message - From: cf coder To: CF-Talk Sent: Wednesday, June 16, 2004 10:35 AM Subject: Re: why doen't sql delete work if it is followed with a cflocation tag yes I am. If I run the query in sql analyser it deletes the row. [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
Re: why doen't sql delete work if it is followed with a cflocation tag
cf coder wrote: I have a form with a cancel button. You mean input type=reset? That is a client side action, it doesn't touch anything on the server. Jochem [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
Re: why doen't sql delete work if it is followed with a cflocation tag
I figured out the problem. Basically what was happenning was, it was deleting the record and re-inserting a new one. That's because I have code just above it that inserts a record if the recordcount is 0. I'm sorry guys for the unnecessary hassle. Best regards, cfcoder [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]