|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
Deleting record on database gives element undefined
Hello!!
HELP!! Ok, Im newish to coldfusion and have got confused! I have made a database, where i can view, edit, add new records and its all working fine. I am trying to also have a delete feature on it. I have created the link for it to delete, and added the commands but im getting an error message when i hit delete saying : "The web site you are accessing has experienced an unexpected error. Please contact the website administrator. The following information is meant for the website developer for debugging purposes. Error Occurred While Processing Request Element DEPART is undefined in QARTIST. " Not sure why its saying 'depart' specfically as that is the 3rd row in the table. Not too sure on where to go frm here. Could i ask for a bit more specific help? I have 3 an index page which displays the 7 rows + a link to edit any of the returned data : <td>#qArtists.CurrentRow#</td> <td>#qArtists.FirstName#</td> <td>#qArtists.LastName#</td> <td>#qArtists.Depart#</td> <td>#qArtists.Hotel#</td> <td>#qArtists.Board#</td> <td>#qArtists.Price#</td> <td><a href="updateartist.cfm?artistid=#qArtists.ArtistID#">Edit</a></td> Then i have a : artist.cfc which i added the delete code to : <cffunction name="deleteArtist" access="public" returntype="void"> <cfargument name="artistid" type="numeric" required="yes"> <cfquery datasource="#application.datasource#"> DELETE FROM artists WHERE ArtistID = #arguments.artistid# </cfquery> </cffunction> then i have a delete.cfm file <cfif IsDefined("form.artistid")> <cfinvoke component="cf8essentials.cfc.Artist" method="deleteArtist"> <cfinvokeargument name="artistid" value="#form.artistid#"/> </cfinvoke> <cflocation url="/cf8essentials/artists/index.cfm" addtoken="no"> </cfif> <cfform> <cfinput type="submit" name="submit" value="Delete"> <cfinput type="button" name="cancel" value="Cancel" onclick="history.back()"> <cfinput type="hidden" name="artistid" value="#url.artistid#"> </cfform> Hope that is a detailed enough explanation of my problem! Any help is greatly appreciaited and if you need me to explain more on what im doing wrong i will try to or i could give more source code. Thanks very very very very much to anyone who helps in advance! ![]() |
|
#2
|
|||
|
|||
|
If you dump the query on your query display page after the delete, do you get anything? Is the query empty? If so you may need a check around the display of the data to ensure that the query has data, i.e.
<cfif qArtists.recordCount> ...output the data.... <cfelse> No data to show. </cfif>
__________________
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 |
|
#3
|
|||
|
|||
|
Quote:
Hello, Thanks for the response! I tried as you said and continued to get errors! The data is all in place it seems and ive got no idea why this isnt working! I thought it was my coldfusion setup at one point but other stuff such as add new rows and edit rows is working fine. I have uploaded the files here : w*w.megaupload.com/?d=ORD1AXEO Is there any chance you could make sure im not missing something major or why this isnt working? need to get this site done by monday for work and im struggling on it! Looked over these pages so many times and jsut cant see what the problem is.. |
|
#4
|
|||
|
|||
|
Yeah, sorry, I'm not going through whatever that site is trying to get me to do just to download your files. If you can post a small part of the code that you think is the source of the error I can have a look, but please don't just post a huge block of code as I don't have time to look through it all.
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ColdFusion Development > Deleting record on database gives element undefined |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|