Logic Machine Forum
trends name - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8)
+--- Thread: trends name (/showthread.php?tid=6101)



trends name - hocine - 02.09.2025

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


RE: trends name - Daniel - 02.09.2025

Try this
Code:
query = 'SELECT name FROM trends'
for _, object in ipairs(db:getall(query)) do
      name=tostring(object.name or '')
      log(name)
end



RE: trends name - hocine - 02.09.2025

(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
 



RE: trends name - Daniel - 03.09.2025

how many trends do you have?


RE: trends name - hocine - 03.09.2025

(03.09.2025, 06:56)Daniel Wrote: how many trends do you have?

i have 34 trends


RE: trends name - Daniel - 03.09.2025

Check the logs in LogicMachine Log tab.


RE: trends name - hocine - 04.09.2025

(03.09.2025, 12:43)Daniel Wrote: Check the logs in LogicMachine Log tab.

thx