Click to See Complete Forum and Search --> : delete checked data


evgin
08-18-2003, 10:04 AM
I want to thank you at first, for your help. I would like to research but I ahve not any time so please help me about the problem:

There is a form and checkboxes on the form. if the user checks then the data which belong to it must be delete from db. How can I do this?

pls help me..

thanx for now

Asim
09-15-2003, 12:10 AM
hi
here is the solution
show.asp
<%set rs=conn.execute("Select * from tablename")%>
<form action=delete.asp method=post>
<%while not rs.eof%>
<input type=checkbox name=id value="<%=rs("id")%>">
<%rs.movenext
wend%>
</form>

delete.asp

<%
for i=1 to request.form("id").count
conn.execute("delete from table name where" &_
" id="&request.form("id")(i)&".")
next
%>
response.redirect "show.asp"

if u have any problem mail me asimkhaliq@hotmail.com
Enjoy