Ash
08-27-2003, 05:26 AM
I've written an archive function that looks through a database of filenames and deletes anything older than a certain date. My code goes :
$result=mysql_query("SELECT filename FROM gallery WHERE date < $gallerylimit",$link);
while ($row=mysql_fetch_array($result)) {
unlink ("../../gallery/thumbs/".$row['filename']);
unlink ("../../gallery/images/".$row['filename']);
}
But I get errors for the unlink commands. Am I allowed to use the '../../' format, or do I have to use an absolute pathname ?
Which PHP command diaplays the full pathname ?
Cheers,
ASh
$result=mysql_query("SELECT filename FROM gallery WHERE date < $gallerylimit",$link);
while ($row=mysql_fetch_array($result)) {
unlink ("../../gallery/thumbs/".$row['filename']);
unlink ("../../gallery/images/".$row['filename']);
}
But I get errors for the unlink commands. Am I allowed to use the '../../' format, or do I have to use an absolute pathname ?
Which PHP command diaplays the full pathname ?
Cheers,
ASh