Userid variable

More
16 Feb 2017 05:38 #3833 by Daniel
Replied by Daniel on topic Userid variable
Hello,
If you want to access the ID of Logged in User then you need to use {loggedinuserid} keyword. For all other get / post data you can use the exact variable name enclosed with braces e.g. for catid you need to use {catid}.

Thanks
Daniel

Please Log in to join the conversation.

  • Vladimir Kocic
  • Topic Author
  • Offline
  • New Member
  • New Member
More
15 Feb 2017 13:10 #3828 by Vladimir Kocic
Userid variable was created by Vladimir Kocic
Hello,
I am trying to get the joomla userid, and based on that to show a table, but {userid} doesn't work. Can you tell me what variable do I need to use?

I tried using the actual userid number where I used the placeholders {userid}, and the query worked.
Code:
SELECT CONCAT(archivio_c1.descrizione_lunga,' (',archivio_c1.descrizione,')') AS Categoria, GROUP_CONCAT(CONCAT(archivio_c2.descrizione_lunga,' (',archivio_c2.descrizione,')') SEPARATOR '<br>') AS Sezione FROM archivio_c1 INNER JOIN archivio_c2 ON archivio_c1.id = archivio_c2.c1 WHERE archivio_c1.descrizione NOT REGEXP '[0-9]' AND security_level IN ((SELECT ulda.lvl1 FROM utenti u JOIN utenti_livello_di_accesso ulda ON u.livello_di_accesso= ulda.id WHERE u.nome_utente = {userid}), (SELECT ulda.lvl2 FROM utenti u JOIN utenti_livello_di_accesso ulda ON u.livello_di_accesso= ulda.id WHERE u.nome_utente = {userid}), (SELECT ulda.lvl3 FROM utenti u JOIN utenti_livello_di_accesso ulda ON u.livello_di_accesso= ulda.id WHERE u.nome_utente = {userid})) GROUP BY Categoria

Please Log in to join the conversation.

Cron Job Starts