mysqlhelper.lua 371 B

12345678910111213141516
  1. local M = {}
  2. local mysqldbx = require "mysqldbx"
  3. -- local tg_app = require "tg_app"
  4. -- function M.loaduser(id)
  5. -- local sql = string.format("select * from `sg_user` where id = %d", id)
  6. -- return mysqldbx.query(sql)
  7. -- end
  8. function M.selectSql(tab_name,key,value)
  9. return string.format("select * from `%s` where %s = %d",tab_name, key,value)
  10. end
  11. return M