close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

dataAssist delete multiple records

Thread began 1/23/2010 8:44 am by randyw2394710 | Last modified 1/24/2010 2:26 am by randyw2394710 | 993 views | 2 replies

anonymous

Hi Randy,

The best way to do that would be to add a single checkbox inside the dynamic loop, but give it a name like : name="deletfile[]"

By using the brackets, it will signify the Post Value which I arbitrarily chose the name "deletefile" to become an array storing all the values.

Next, make the checked value equal to the ID of the item.

You will then need to wrap you entire table into a form tag. Set the method to post and I would make the action go to a separate page in this case to process the deletion. Create a page called deletefiles.php for example and then set the action in your form to deletefiles.php.

Somewhere before your closing form tag, you will need two things: a button to execute the form and also a hidden input with the value set to "MM_Update". The reason I do this is to make sure that the delete process page could never run without the presence of the MM_Update flag in the Post array.


The next thing is to add the code to deletefiles.php. You won't need any html on the page, so if you are using Dreamweaver, you can delete all the automatically generated stuff since this page is simply going to process the deletes and then redirect back to the results page.

Your code on the deleting page will look like this:

php:
<?php
  
if (isset($_POST["MM_update"])) {
                 

              
$deletes $_POST['deletefile'];
              foreach (
$deletes as $item){
                          
DELETE FROM table WHERE id $item

            

           
header('Location: original_results_page.php');
   exit;
  }
  
?>



That's it.

Best regards,

Brian

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...