查询用户接口返回json数据
This commit is contained in:
parent
756f9b7343
commit
f3c602f90e
|
|
@ -64,12 +64,12 @@ function _M.getUser(id)
|
|||
ngx.exit(ngx.HTTP_NOT_FOUND)
|
||||
end
|
||||
--整理数据库结果返回值
|
||||
for _, row in ipairs(res) do
|
||||
for key, value in pairs(row) do
|
||||
ngx.say(key .. ":" .. tostring(value))
|
||||
end
|
||||
end
|
||||
|
||||
--for _, row in ipairs(res) do
|
||||
-- for key, value in pairs(row) do
|
||||
-- ngx.say(key .. ":" .. tostring(value))
|
||||
-- end
|
||||
--end
|
||||
ngx.say(cjson.encode(res))
|
||||
--关闭数据库
|
||||
conn:disconnect()
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user