Below is my form submit statement for my site. I know that the query works by it self however it does not seem to be setting the variable correctly. Does anybody see why this would not work, or am I going about this the wrong way? Basically my module uploads a file and then on submit this function query's the DB for the upload path and needs to set that value to be a drupal variable. Any Ideas?
function background_audio_form_submit($form, $form_state) {
$result = db_query("SELECT uri
FROM `file_managed`
WHERE `filemime` = 'audio/mpeg'
LIMIT 1");
return $result;
variable_set('background_audio_upload_path', $result-->uri);
}