dadamssg Posted July 21, 2009 Share Posted July 21, 2009 I have a database that stores events and it works fine. I do a cron to delete all the events that have ended. But now i'm developing an image upload feature for an event. So...someone creates an event and now they have the option to upload a picture to accompany it. As the pictures are completely separate from my database, i can't figure out the best way to delete them. Cause i want the pictures to be deleted along with the expired events and a cron would be excellent if i figure the theory out. Anybody have any ideas? Quote Link to comment Share on other sites More sharing options...
waynew Posted July 22, 2009 Share Posted July 22, 2009 How do you connect the uploaded image to the event? Are you using a custom upload form or are you using a WYSIWYG editor such as TinyMCE? Quote Link to comment Share on other sites More sharing options...
RichardRotterdam Posted July 22, 2009 Share Posted July 22, 2009 But now i'm developing an image upload feature for an event. So...someone creates an event and now they have the option to upload a picture to accompany it. As the pictures are completely separate from my database There has to be some sort of way you have related the images to the events? How for example do you show the images that are related to a certain event? If you don't have any relation what's the point of uploading an image for an event if there is no relation to begin with? Quote Link to comment Share on other sites More sharing options...
dadamssg Posted July 23, 2009 Author Share Posted July 23, 2009 when they upload the image...i rename it then put that name in my database in the row for that event. I have a column field "Picture". an example text in it would be something like "1248324900LAdmin456.png" Quote Link to comment Share on other sites More sharing options...
RichardRotterdam Posted July 23, 2009 Share Posted July 23, 2009 when they upload the image...i rename it then put that name in my database in the row for that event. I have a column field "Picture". an example text in it would be something like "1248324900LAdmin456.png" Do you mean you have a table for your events such as: events - id - name - description - date - picture If that is the case why don't simply do a select query to fetch the image name and delete it with that information? Quote Link to comment Share on other sites More sharing options...
waynew Posted July 23, 2009 Share Posted July 23, 2009 Then simply search through the table collecting the id number and image directory of each event that is going to be deleted. Delete the images. THEN delete the record from the DB. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.