摘要:
使用MySQL 默认安装OpenResty时已经自带了mysql模块 我们编写一个案例,操作mysql数据库,编辑test.lua 定义关闭mysql的连接 local function close_db(db) if not db then return end db:close() end lo 阅读全文
posted @ 2025-04-13 11:15
小郑[努力版]
阅读(41)
评论(0)
推荐(0)
摘要:
连接redis服务器 基本使用 定义 redis关闭连接的方法 local function close_redis(red) if not red then return end local ok, err = red:close() if not ok then ngx.say("close r 阅读全文
posted @ 2025-04-13 11:08
小郑[努力版]
阅读(140)
评论(0)
推荐(0)
摘要:
引入cjson模块 local json = require(“cjson”) json.encode 将表格(table 包含哈希键值对 和 数组键值对)数据编码为 JSON 字符串 格式: jsonString = json.encode(表格对象) table转json字符串 table包含哈 阅读全文
posted @ 2025-04-13 10:51
小郑[努力版]
阅读(86)
评论(0)
推荐(0)

浙公网安备 33010602011771号