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.

trends name
#1
Hello 

Is it possible to retrieve the trends names for display in an application?
I would like to create a LogicMachine interface where clients can select trends from a dynamically generated list based on available curves.

THX
Reply
#2
Try this
Code:
query = 'SELECT name FROM trends'
for _, object in ipairs(db:getall(query)) do
      name=tostring(object.name or '')
      log(name)
end
------------------------------
Ctrl+F5
Reply
#3
(02.09.2025, 14:14)Daniel Wrote: Try this
Code:
query = 'SELECT name FROM trends'
for _, object in ipairs(db:getall(query)) do
      name=tostring(object.name or '')
      log(name)
end
I try this but i don't have all the trends 
Code:
local rows = db:getall("SELECT id, name FROM trends ORDER BY name COLLATE NOCASE")
for _, r in ipairs(rows or {}) do
  log(string.format('%s (id=%s)', tostring(r.name or ''), tostring(r.id or '')))
end

if not rows or #rows == 0 then
  log('[db-trends] Aucun enregistrement trouvé dans la table trends (ou table vide).')
end
 
Reply
#4
how many trends do you have?
------------------------------
Ctrl+F5
Reply
#5
(Yesterday, 06:56)Daniel Wrote: how many trends do you have?

i have 34 trends
Reply
#6
Check the logs in LogicMachine Log tab.
------------------------------
Ctrl+F5
Reply
#7
(Yesterday, 12:43)Daniel Wrote: Check the logs in LogicMachine Log tab.

thx
Reply


Forum Jump: