-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.lua
More file actions
18 lines (16 loc) · 699 Bytes
/
main.lua
File metadata and controls
18 lines (16 loc) · 699 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
local libmysql = require("libmysql")
local db_member = libmysql:new("member")
local db_test = libmysql:new()
local res, err = db_member:query("select des from test1 where (test_id=? )", {3})
if err or not res or type(res)~="table" or #res<1 then
ngx.say("test database member query :nothing")
else
ngx.say("test database member query :res")
end
local res, err = db_test:query("select des from test1 where test_id=? ;", {3})
if err or not res or type(res)~="table" or #res<1 then
ngx.say("test database test query :nothing")
else
ngx.say("test database test query :res")
end
local res, err = db_test:main("UPDATE test1 SET des='my lua' WHERE test_id=?", {3})