I have a directory with backups. Those files have the name like this: date('d-m-Y-H-i-s').".sql
. When I want to restore the files I need the last modified file to backup. How do I get the name of that file to use it in code?
This is the code for restore:
$command='mysql -h' .$mysqlHostName .' -u' .$mysqlUserName .' -p' .$mysqlPassword .' ' .$mysqlDatabaseName .' < '.$mysqlImportFilename;
exec($command);
What do I have to write on $mysqlImportFilename
?