Question
Deleting Problem
Hi, I think the Deleteion problem is very Problammtic to me
instead, I am Impleting the Comments section which is shown when
the admin approves them. BVasic form where the user submit the
comments and then the link is sent to the admin. then admin is
clicked the link a new page is opened where the option of like this
is shown:
<cfif StructKeyExists(URL,'ImageID')>
<cfquery datasource="#dsn#" name="showcomments">
Select Comments, postedby from IComm
where ImageID = <cfqueryparam cfsqltype="CF_SQL_INTEGER" value="#URL.ImageID#">
</cfquery>
<cfform method="post" action="docomments.cfm">
<cfinput type="hidden" name="SID" value="#URL.ImageID#">
<table align="center" width="75%">
<cfoutput query="showcomments">
<tr>
<td width="20">
<input type="checkbox" name="MyComm" value="1"></td>
<td class="navLink_plain">
#Trim(showcomments.comments)#
</td>
</tr>
<tr>
<td colspan="2">
Posted By: #showcomments.postedby#
</td>
</tr>
</cfoutput>
<tr>
<td colspan="2"><div align="center">
<input type="submit" name="axtion" value="Delete">
<input type="submit" name="axtion" value="Update">
</div></td>
</tr>
</table>
</cfform>
<cfelse>
</cfif>
so this the page where the admin has to choose the checkboxes and then delete them.
the deletion page is not working properly as i am implementing like this:
<cfif form.axtion IS "Delete">
<cfset minusvalue = Replace(form.MyComm,",","-","")>
<cfquery datasource="#dsn#">
Update IGall SET
comments = comments - #minusvalue#
where ID = #form.SID#
</cfquery>
<cfquery datasource="#request.datasource#">
Delete From IComm
WHERE ImageID = <cfqueryparam cfsqltype="cf_sql_integer" value="#form.SID#">
</cfquery>
</cfif>
thus when i delete the selected the checkbox value, it deletes the all values in the IComm table, while the other tables values comes to correct value.
i experimented in a lot way but in vain, if anyone had have hands in this plz help me
<cfif StructKeyExists(URL,'ImageID')>
<cfquery datasource="#dsn#" name="showcomments">
Select Comments, postedby from IComm
where ImageID = <cfqueryparam cfsqltype="CF_SQL_INTEGER" value="#URL.ImageID#">
</cfquery>
<cfform method="post" action="docomments.cfm">
<cfinput type="hidden" name="SID" value="#URL.ImageID#">
<table align="center" width="75%">
<cfoutput query="showcomments">
<tr>
<td width="20">
<input type="checkbox" name="MyComm" value="1"></td>
<td class="navLink_plain">
#Trim(showcomments.comments)#
</td>
</tr>
<tr>
<td colspan="2">
Posted By: #showcomments.postedby#
</td>
</tr>
</cfoutput>
<tr>
<td colspan="2"><div align="center">
<input type="submit" name="axtion" value="Delete">
<input type="submit" name="axtion" value="Update">
</div></td>
</tr>
</table>
</cfform>
<cfelse>
</cfif>
so this the page where the admin has to choose the checkboxes and then delete them.
the deletion page is not working properly as i am implementing like this:
<cfif form.axtion IS "Delete">
<cfset minusvalue = Replace(form.MyComm,",","-","")>
<cfquery datasource="#dsn#">
Update IGall SET
comments = comments - #minusvalue#
where ID = #form.SID#
</cfquery>
<cfquery datasource="#request.datasource#">
Delete From IComm
WHERE ImageID = <cfqueryparam cfsqltype="cf_sql_integer" value="#form.SID#">
</cfquery>
</cfif>
thus when i delete the selected the checkbox value, it deletes the all values in the IComm table, while the other tables values comes to correct value.
i experimented in a lot way but in vain, if anyone had have hands in this plz help me