This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Mysql query
#1
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
Reply
#2
Look here, make sure you install correct packages as this thread is very old
https://forum.logicmachine.net/showthrea...797#pid797
------------------------------
Ctrl+F5
Reply
#3
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
Reply
#4
Extra packages are always below the firmware links
https://dl.openrb.com/lm-23-imx6/pkg/
------------------------------
Ctrl+F5
Reply
#5
ok....and the docs about it, please ?
KNX Advanced Partner + Tutor
Reply
#6
https://forum.logicmachine.net/showthread.php?tid=193
Reply
#7
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
Reply


Forum Jump: