School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become an Expert!

Join 307,218 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,620 people online right now. Registration is fast and FREE... Join Now!




delete entries

 

delete entries

aylin0315

21 Oct, 2007 - 05:41 PM
Post #1

New D.I.C Head
*

Joined: 16 Oct, 2007
Posts: 4


My Contributions
i am doing a sample program of add, edit and delete but i cant view the entries that i wanted to delete, as well i cant also delete the data on my database using the form.
here's my code.. hope anyone can help me with this.. thanks..

<cfquery datasource="aileen" name="getDetails">
SELECT * from sample
</cfquery>


<html>

<cfoutput>
<table>
<tr bgcolor="blue" bordercolor="black">View Details
<td>ID</td>
<td>FirstName</td>
<td>MiddleName</td>
<td>LastName</td>
<td>Address</td>
<td>ContactNo</td>
<td>School</td>
</tr>
<cfloop query="getDetails">
<tr><cfform action="view2.cfm" method="get">
<td><cfinput value="#getDetails.id#" name="id" size="5"/></td>
<td><cfinput value="#getDetails.last_name#" name="last_name" size="10"/></td>
<td><cfinput value="#getDetails.middle_name#" name="middle_name" size="10"/></td>
<td><cfinput value="#getDetails.last_name#" name="last_name" size="10"/></td>
<td><cfinput value="#getDetails.address#" name="address" size="10"/></td>
<td><cfinput value="#getDetails.contact_number#" name="contact_number" size="10"/></td>
<td><cfinput value="#getDetails.school#" name="school" size="10"/></td>
<td><input name="btnEdit" type="submit" id="btnEdit" value="edit" onClick="http://localhost:8500/update.cfm?edit=edit" /></td>
<td><INPUT type="submit" name="btnDelete" value="DELETE!" id="btnDelete" onClick="http://localhost:8500/update.cfm?delete=delete"/></td>
<cfif isdefined ('form.id')>
<cfquery datasource="aileen" name="deleteDetails">
DELETE id from sample
where id = #form.id#

</cfquery>
</cfif>

</cfform>
</tr>
</cfloop>
</table>
</cfoutput>
</html>


User is offlineProfile CardPM
+Quote Post


Posts in this topic

Fast ReplyReply to this topicStart new topic

Time is now: 11/21/09 10:18PM

Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month