Im not sure what you are asking..
If the column is varchar, what is being passed in as the value? Is it NULL? A number? Are you getting a SQL error? Have you tried doing a var_dump on $r and seeing what is actually in there? Are you sure buy_temp has a valid "option" column?
So many points of potential failure, it's hard to debug from what you have given...