Home News Contact Us Forum About Us Demos Products F.A.Q.
Shopping Cart
You currently have 0 items in your cart.


Recent Events
  • 31/12/2023 New Year SALE

    We are glad to announce New Year SALE. 25% discount for all our extensions. Use NY24 coupon code. Hurry up the discount is valid till 7 January.

  • 21/11/2023 BLACK FRIDAY 23 is coming

    BIG SALE, 35% discount for all our extensions. Use BF23 coupon code. Hurry up the discount is valid till 27 November.


2Checkout.com, Inc. is an authorized retailer of goods and services provided by ARI Soft. 2CheckOut




Follow us on twitter



Welcome, Guest
Please Login or Register.    Lost Password?

Get Joomla userid for the query
(1 viewing) (1) Guest
Go to bottomPage: 1
TOPIC: Get Joomla userid for the query
#59655
Get Joomla userid for the query 7 Years, 2 Months ago Karma: 0
Hello,
I'd like to use the current logged user joomla ID to determine their access level. What placeholder do I use in the SQL query?

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

The administrator has disabled public write access.
 
#59658
Re:Get Joomla userid for the query 7 Years, 2 Months ago Karma: 748
Hello,

Use {$UserId} variable. Something like this:

WHERE user_id = {$UserId}

Regards,
ARI Soft
The administrator has disabled public write access.
 
#59677
Re:Get Joomla userid for the query 7 Years, 2 Months ago Karma: 0
Thanks, it worked
The administrator has disabled public write access.
 
Go to topPage: 1