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?

Help with query
(1 viewing) (1) Guest
Go to bottomPage: 1
TOPIC: Help with query
#54413
Help with query 8 Years, 11 Months ago Karma: 0
Hello,

We have a competition at work where all register their workout.
I use ARI Data Tables to present the results for the whole group.
It's on our intranett, so all have to log in to register. The logged in user name is stored with the data.

Some users want to see their own workout results, but don't want everybody else to see the data.

Is it possible to use the Joomla! user name in the query in any way to get individual queries? Can I use
Code:

$user = JFactory::getUser();
in the SQL query in any way?

Regards,

Arne Kristian
The administrator has disabled public write access.
 
#54415
Re:Help with query 8 Years, 11 Months ago Karma: 747
Hello,

Use {$UserLogin} or {$UserName} variable in WHERE clause of "SELECT" SQL query. For example:

Code:


SELECT
 *
FROM
 #__users
WHERE
 username = {$UserLogin}



or

Code:


SELECT
 *
FROM
 #__users
WHERE
 name = {$UserName}



Regards,
ARI Soft
The administrator has disabled public write access.
 
Go to topPage: 1