close ad
Help us test the new Databridge BETA with MySQLi support
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Delete multiple records and associated files

Thread began 11/15/2012 7:08 am by davegw | Last modified 1/28/2014 12:02 pm by Jason Byrnes | 2037 views | 10 replies |

davegw

Delete multiple records and associated files

Can Data Bridge delete files associated with records when using the Multiple File Delete SB?
Not sure if this is integrated now with the File Manipulation > Delete File

Sign in to reply to this post

Jason ByrnesWebAssist

You would need to hand code this.

you would need to loop through the ID's of the records being deleted, in the loop, use a recordset to find the file name and delete the file.

Sign in to reply to this post

Miguel

I been trying to do this but with no luck since the new way data assist works with that popup delete thing unless i send the user to a page that has the behavior on page load how can we do this to delete all associated files from records.

i have try

showthread.php?t=24685&highlight=delete

also

t-27281.html

No luck so far if i dont do a new page that has everything on pageload then redirect to a page to delete records but this way i cant even ask the user if he is sure cause the methods on those other post dont work with a submit button and with submit button i can not add the record directly dunno why only a form field with the name of the file to delete

Sign in to reply to this post

Jason ByrnesWebAssist

the id of the record to delete is passed to the delete behavior in a form element named:
WADADeleteRecordID


you would need to create a recordset that returns the file names, use the WADADeleteRecordID form element to filter the ID column of the recordset

then hand code logic to loop through the recordset, and delete the files.

Sign in to reply to this post

Miguel

Originally Said By: Jason Byrnes
  the id of the record to delete is passed to the delete behavior in a form element named:
WADADeleteRecordID


you would need to create a recordset that returns the file names, use the WADADeleteRecordID form element to filter the ID column of the recordset

then hand code logic to loop through the recordset, and delete the files.  



I tried that already the only problem is that it does not delete all the files it seems that it looks for form elements and not acepts me to put the recordset directly

Sign in to reply to this post

Jason ByrnesWebAssist

  and not acepts me to put the recordset directly  



well, like i said, you need to hand code the loop through the recordset to do the delete.

the first link in your message was good example.

Sign in to reply to this post

sublucentBeta Tester

Link to hand coding example for multiple file deletes

For anyone else searching for this, here is a link to an example of how to hand code the loop to delete multiple files: showthread.php?t=27281&highlight=loop+file+delete

I also found that you can delete from multiple folders by adding additional $WA_DeleteFileResults

php:
<?php do { ?> 

<?php
$WA_DeleteFileResult1 
false;
$WA_DeleteFileResult2 false;
if(!(
$totalRows_rsLBimageDelete == 0)){
    
$WA_DeleteFileResult1 WA_FileAssist_DeleteFile("../images/lookbook/img/""".$row_rsLBimageDelete['imagelImage']  ."");
    
$WA_DeleteFileResult2 WA_FileAssist_DeleteFile("../images/lookbook/img/thumbnail/""".$row_rsLBimageDelete['imagelImage']  ."");
}
?>
<?php 
} while ($row_rsLBimageDelete mysql_fetch_assoc($rsLBimageDelete)); ?>


Anyone please chime in if there's a better way to do it.

Sign in to reply to this post

Miguel

reopening this thread i still not able to delete files when they are linked to another table that is suppose to be deleted i tried what every post here says without any luck added an attachment to see where i am wrong

Sign in to reply to this post

Jason ByrnesWebAssist

the recordsets you have to lookup the files to delete are being filtered on a URL variable, that URL variables probably doesn't exist when the delete button pressed.

try using the WADADeleteRecordID post element instead.

Sign in to reply to this post

Miguel

Thank you Jason that seem to do the trick

Sign in to reply to this post
loading

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...