Perhaps I should start over and ask in a semi-generic fashion.
How does one delete (unlink) a 'range' of graphic files?
There is a mySQL table - let's call it MyTable.
This table has a field called MyThumb. This field holds the actual name of a graphic image. (The actual graphic file is uploaded to the server and exists in a subdir called /thumbs.)
I need to delete records from MyTable based on a range - and that range can be found by searching on a field called 'gallery'.
Therefore, I also need to delete the actual graphic image files that correspond with each of these found records.
For example, this code will find a range of records:
$q1 = "select * from MyTable where gallery=$nid";
$r1 = mysql_query($q1) or die("Problem with the query: $q1<br>" . mysql_error());
It will also, therefore, find a 'range' of graphic image file names.
If this found range (from the code above) contains 3 records, it will contain 3 values from the field MyThumb.
These 3 values are the actual names of the graphics that have been uploaded to the server. For example, these names could be: MyImage1.jpg, MyImage2.jpg and MyImage3.jpg.
I know how to actually delete the records (easy enough) but how do I delete (unlink) the actual graphic files contained in this range? How do I delete MyImage1.jpg, MyImage2.jpg and MyImage3.jpg from the server?
I assume that an array of the image names would be used - but I just can't get it to work.
I truly hope this makes the problem clearer. Any help would be greatly appreciated.