Hi
If you are looking at just changing the name while downloading then you can set it as a part of your download headers, read below
if ($startdownload == "yes") {
header("Content-type: application/x-ms-download;name=$path_to_file");
// $path_to_file is the download path, note if the above still doesnt // open the "Save Dialogue" use
// "Content-type: application/force-download "
header("Content-Disposition: attachment; filename=$download_as");
// replace the $download_as with your filename from the database
exit;
}