The name of the CSV is set on this line:
header('Content-Disposition: attachment; filename=myform.csv');
So you can move the header setting below the recordset and get that value from the recordset like:
header('Content-Disposition: attachment; filename=' .$rows->getColumnVal("fm_title"). '.csv');


