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


Recent Events
  • 05/09/2017 BIG Autumn SALE

    Use AUTUMN17 coupon code to buy our WordPress or Joomla! extensions with 25% discount. Hurry up! The offer is valid till 11 September.

  • 14/04/2017 Happy Easter

    Wish a Happy Easter and give 30% discount for all our WordPress and Joomla! extensions. Use EASTER17 coupon code. The offer is valid till 17 April.


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 8 Months, 1 Week 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 8 Months, 1 Week ago Karma: 667
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 8 Months, 1 Week ago Karma: 0
Thanks, it worked
The administrator has disabled public write access.
 
Go to topPage: 1