Posts: 106
Threads: 40
Joined: Sep 2017
Reputation:
0
Hi,
where can I find an "how to" for mysql integration ?
For example:
I want insert/read some values in a remote database (in the same LAN).
If there is an example it'll be appreciate.
BR,
Alberto
KNX Advanced Partner + Tutor
Posts: 4638
Threads: 24
Joined: Aug 2017
Reputation:
207
Look here, make sure you install correct packages as this thread is very old
https://forum.logicmachine.net/showthrea...797#pid797
------------------------------
Ctrl+F5
Posts: 106
Threads: 40
Joined: Sep 2017
Reputation:
0
17.10.2023, 13:34
(This post was last modified: 17.10.2023, 13:36 by toujour.)
thanks for your reply but I don't find the correct link in that thread...all the links are offline (404).
Can you check it, please ?
KNX Advanced Partner + Tutor
Posts: 4638
Threads: 24
Joined: Aug 2017
Reputation:
207
Extra packages are always below the firmware links
https://dl.openrb.com/lm-23-imx6/pkg/
------------------------------
Ctrl+F5
Posts: 106
Threads: 40
Joined: Sep 2017
Reputation:
0
ok....and the docs about it, please ?
KNX Advanced Partner + Tutor
Posts: 106
Threads: 40
Joined: Sep 2017
Reputation:
0
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