PDA

View Full Version : Query to delete attachment (and file)


Lincoln
09-18-2007, 01:38 PM
I'm trying to create a simple script that will delete all posts AND attachments in a particular thread older than a certain date, skipping the first post.

I'm pretty confident I can write the query to remove the posts fine, but what query / PHP do I need to both remove the attachment reference from the database and delete the file as well? And, on a related note, how do I figure out where my attachments are stored in the filesystem? I'm pretty sure, but I'd like to confirm.

Thanks!

Dismounted
09-19-2007, 04:50 AM
The attachment table stores all the information for attachments.

Paul M
09-19-2007, 07:09 AM
Accept the attachments themselves, which can also be stored in the file system.