Contact Us Today! | vcare@wdmtech.com

WDMtech

Topic-icon Userid variable

More
4 months 1 week ago #3833

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 or Create an account to join the conversation.

  • Vladimir Kocic
  • Vladimir Kocic's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
More
4 months 1 week ago #3828

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.

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 or Create an account to join the conversation.