The Article is very Simple, We will create a simple table with four fields. ID Name Images Description Now the table data is filled up with the basic information. So you just need to add the coldfusion code to all the work for you. Suppose you called the Page as: <cfif isDefined('form.checkall')> <cfquery datasource="abc" name="getdelall"> delete from table[Name of the table] where ID IN (<cfqueryparam cfsqltype="cf_sql_numeric" value="#trim(form.getRecords)#" list="yes">) </cfquery> <cfset msg = "Deleted"> </cfif> <form name="form1" method="post" action="<cfoutput>#CGI.SCRIPT_NAME#</cfoutput>"> <table width="100%" border="0" cellspacing="2" cellpadding="2"> <tr> <td>S.No</td> <td>Name</td> <td>Image</td> <td>Description</td> </tr> <cfif isdefined('msg')><tr><td colspan="4" align="center"><cfoutput>#msg#</cfoutput></td></tr></cfif> <cfoutput query="showrecords"> <tr> <td><input type="checkbox" name="getRecords" value="<cfoutput>#ID#</cfoutput>"></td> <td>#name#</td> <td>#image#</td> <td>#description#</td> </tr> </cfoutput> <tr><td colspan="4"> </td></tr> <tr><td><input type="submit" name="checkall" value="Delete"></td></tr> <tr><td colspan="4"> </td></tr> </table> </form>
Make sure you use the cfqueryparam tag, it is the best tag and if you use it you are safe from hackers Cheers |