Jump to content

Dir + MySQL help


duncan121

Recommended Posts

Hi experts.

I have a directory with files waiting to be installed.
Once they have been installed they are registered in a MySQL database.

I want the files which have been installed to be invisible in a list.

I have managed to write the code to look at the directory and remove a single file.  However I can get it to do the operation for all the installed files.

Please see my code...

Thanks for your help.
Duncan

$get_modules2 = new DB();
$get_modules2->query("SELECT * FROM ".DB_PREFIX."_modules");
while ($display_modules2 = $get_modules2->next_record()) {
$mods = $display_modules2['name'];
}

$this_dir = dir('modules/');
while ($file = $this_dir->read()) {
if($file != '.' && $file != '..' && $file != 'home' && $file != 'admin' && $file != 'system' && $file != $mods)
{
echo $file;
}
}
Link to comment
https://forums.phpfreaks.com/topic/30998-dir-mysql-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.