title: Using a variable in Ruby Mysql query
body: <p>I have a name stored in the variable <code>username</code> and would like to pull users row information when I try</p>
  
  <pre><code>result = dbh.query("SELECT * FROM maintab WHERE user = '#{username}'")
  </code></pre>
  
  <p>I get no results. If I put in the username by hand however,  it does return a result. How format my query so that I may use variables?</p>