Re: How to delete contents from a mysql database
Posted: Mon Jan 16, 2012 11:49 am
It works awesomely, thanks very much.
Off topic, I'm going to create a post about it, but I have the following function:
To delete directories, I have a field inside this database that is path, where I get the path of the directory with its contents, I would like as I'm deleting the database entries to also delete the directories with the given function, how to?
Thanks in advance.
Off topic, I'm going to create a post about it, but I have the following function:
Code: Select all
function rrmdir($dir) {
if (is_dir($dir)) {
$objects = scandir($dir);
foreach ($objects as $object) {
if ($object != "." && $object != "..") {
if (filetype($dir."/".$object) == "dir") rrmdir($dir."/".$object); else unlink($dir."/".$object);
}
}
reset($objects);
rmdir($dir);
}
}
Thanks in advance.