$sth2 = $dbh ->prepare("select filename, type from library where filename = $file_index and".$rule_append);