You could simply paste to concatenate the strings.
med <- "some text"
command <- paste0("select rhs from df_basket12 where lhs like '%", med, "%'")
df_rhs<- sqldf(command)
Addendum:
I'm not sure what your function is supposed to do... but the output stored in the med variable should be a string valid as a part of an SQL statement.
Addendum 2:
If you want to loop through multiple elements you will need to figure out what to do with the different outputs of the different queries. As you did not state a clear direction, I've stored them in a list.
med <- c("a", "b") #this would be your multiple element vector
results=list() #init an empty list
#loop through the vector
for (i in (med)) {
command <- paste0("select rhs from df_basket12 where lhs like '%", i, "%'")
results[i] <- sqldf(command)
}