Select values from MySQL and pass it to R consequent