title: Why does the MySQL query fail within this Lua script?
body: <p>So I have a little game that is using LuaJIT and also LuaPower's MySQL client library.</p>
  
  <p>Now, I have successfully made a connection and I am also able to select tables for example, but I was unable to insert any data into the tables.</p>
  
  <p>The error itself is:</p>
  
  <blockquote>
    <p>FATAL ERROR [UNHANDLED EXCEPTION]: Attempt to call uninitialized function pointer</p>
  </blockquote>
  
  <p>Here is my Lua code, so you can understand what I am trying to do:</p>
  
  <pre class="lang-lua prettyprint-override"><code>addhook("join", "onJoin")
  addhook("minute", "saveStats")
  addhook("say", "logChat")
  addhook("say","onSay")
  
  local mysql = require'mysql'
  
  -- MySQL Connection Details:
  sql_host = "localhost" -- Host
  sql_user = "root" -- USER
  sql_password = "1c%CIuROpD17" --Pass
  sql_db_name = "cs2d" -- DBNAME
  sql_port = 3306 
  
  local con = mysql.connect(sql_host, sql_user, sql_password, sql_db_name, 'utf8')
  
  function onJoin(id)
  local usgn = player(id, "usgn")
  local ip = player(id, "ip")
  local name = player(id, "name")
  local datime = os.date("%c")
  
       if usgn &gt; 0 then
            -- con:query("INSERT INTO `logins`(`col_int`,`col_varchar`,`col_varchar`,`col_varchar`,`col_datetime`) VALUES (usgn, ip, name, datime)")
            print("a")
            msg("new player joined!")
  
       elseif usgn == 0 then
           -- con:query("INSERT INTO `logins`(`col_int`,`col_varchar`,`col_varchar`) VALUES (name, datime)")
       end
  
  end
  </code></pre>
  
  <p>Unfortunately the query seems to be incorrect format or at least no real clue on which way could I make this happen.</p>
  
  <p>I can't seems to debug it further. But I believe must be related the way I am trying to make the query, as for example selecting tables works with with the same connection.</p>