函数:close() 关闭数据库
函数名称:关闭数据库
函数功能:关闭数据库
引擎版本:仅支持 Androidv3.2.0、iOSv3.1.0 及其以上版本
函数方法
close()
函数用例
local luasql = require "luasql.mysql"
-- 创建环境对象
mysql = luasql.mysql()
-- 连接数据库
conn,msg = mysql:connect("test","root","password","10.0.0.41",3306)
if conn then
--操作数据库
conn:execute("insert into testtb(num,name) values(120,'123')")
--关闭数据库
conn:close()
else
dialog("连接失败:"..msg)
end
注意事项
iOS 专业版/个人版已内置此函数库,无需单独下载;其他产品需要单独导入 so 文件。
使用及函数库下载详见上方 mysql 函数库使用方法及下载。