18.10.2023, 07:54
ok, this for request (it works with luamysql package).
Code:
require('luasql.mysql')
env = luasql.mysql()
dbcon = env:connect(DB_NAME, USERNAME, PASSWORD, MYSQL_SERVER_IP, MYSQL_SERVER_PORT)
cursor = dbcon:execute('SELECT * FROM mytable')
while true do
row = cursor:fetch({}, 'a')
if row then
log(row)
else
break
end
end
cursor:close()
dbcon:close()
env:close()
KNX Advanced Partner + Tutor