>No solutions or feedback? >:( >-Tom Reed >centrex@xxxxxxxxxxxxxx _________________________________ How do you select _all_ the images from Folder B? Can you show that statement? In every delete you're able to do against a database table, you should first be able to run a select and basically replace 'select [stuff]' with delete. Now this rule is a little shakey when it comes to deleting from multiple tables using joins, but similar logic applies. I'm a little confused by your structure, this looks to me that it may have been more appropriate to use multiple tables to build relationships. Thats not to say i'm right...cause i may not be. HTH Jeff ____________________________________ "Tom Reed" <tom@xxxxxxxxxxxxxxx> wrote in message news:20040325061258.56792.qmail@xxxxxxxxxxxxxxx > I designed a photo gallery system, in which I allow users to create > recursive photo "folders." The trouble I am having is being able to delete > a photo folder, and all folders/photos within it. > > Example structure: > > Main Folder > - Folder 1 > - Folder a > - Folder b > - Folder i > - Folder ii > - Folder aa > -Folder bb > - Folder 2 > - Folder 2a > ... > > I am having trouble creating code to delete all folders within the folder > they choose to delete. > > Say I want to delete "Folder b." In addition to deleting "Folder b," the > code also needs to delete folders "Folder i," "Folder ii," "Folder aa," and > "Folder bb." > > Here's how I've setup the photo gallery table: > > CREATE TABLE `gallery` ( > `uniqueid` int(11) unsigned default NULL, > `gallery` int(11) default NULL, > `image` varchar(255) default NULL, > `height` int(11) default NULL, > `width` int(11) default NULL, > `thumbnail` varchar(255) default NULL, > `title` varchar(150) default NULL, > `description` text, > `location` int(11) unsigned default NULL, > `uploaded_by` int(11) default NULL > ) TYPE=MyISAM; > > uniqueid is the id of the folder. > gallery is the folder depth (0=photo, 0=main folder, 1=sub folder level 1, > 2==sub folder level 2...) > location is the folder this sub-folder is located in > > Seems this code may be fairly complex. I've made about three attempts, with > no success and I figured this would be the best place to ask. > > Any help would be appreciated. > > -Tom Reed > centrex@xxxxxxxxxxxxxx -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php