Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need Help! delete all checked...

Status
Not open for further replies.

dv8er88

Programmer
Feb 21, 2005
42
US
HI I have output a list of items from the Mysql DB.

The way I normally do this is to output a new form around each record with a hidden ID a its own delete button for each. Like this:

<form name="form1" method="post" action="content_sat_g_rates.cfm?action=delete">
<input name="ID" type="hidden" id="ID" value="#ID#">
<input name="item" type="text" id="item" value="#item#">
<input type="submit" name="Submit" value="Delete">
</form>


So each time I submit I can use the ID to update or Delete the record.

How can I update or Delete multiple records that are checked?

I hope you guys understand..

Thanks,
D
 
i am not familiar with mySql but in SQL you would do

DELETE FROM myTable
WHERE myID in (<cfqueryparam list="yes" value="#FORM.ID#">)


same thing goes with update statement too

UPDATE myTable
SET ....
WHERE myID in (<cfqueryparam list="yes" value="#FORM.ID#">)


hope it helps...

 
be aware that using UPDATE and IN will upadte all the matching rows to the same value.

judginh by the fact that you would have a text box for each ID, I would asume you wanted each row to have it's own update statement.

the delete works just fine with IN, as your deleting them all...

Kevin

Phase 1: Read the CFML Reference
Phase 2: ???
Phase 3: Profit!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top