title: Lua mysql, need a way to escape data
body: <p>I need a way to escape data for mysql statements in lua.  I'm used to doing something like mysql_real_escape_string() in php but can't find an equivalent in lua using mysql (con:escape() worked when I was using sqlite3).  I've read that prepared statements are a solution but it doesn't seem to work for me.  What am I doing wrong?</p>
  
  <pre><code>require "luasql.mysql"
  env = assert (luasql.mysql())
  con = env:connect("db_name", "user", "pass", "localhost")
  local stmt = con:prepare([[
      SELECT * FROM `user` 
      WHERE `login` = :a AND `pass` = :b LIMIT 1
  ]])
  stmt.a = "some_user"
  stmt.b = "some_pass"
  </code></pre>
  
  <p>This errors with "attempt to call method 'prepare' (a nil value)".</p>
  
  <p>If I try to run a straight SELECT * execute on con it works fine, so the connection is being made, but this prepare statement does not work (it's not even recognizing prepare as a valid method, it seems).</p>