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?

UserID in a complex query
(1 viewing) (1) Guest
Go to bottomPage: 1
TOPIC: UserID in a complex query
#32960
UserID in a complex query 11 Years, 6 Months ago Karma: 0
I'm trying to get data for the current user by adding the userID variable, but it returns no text when I add the bold content below. Is my syntax off? The query works fine in the module without this addition (copied from another module).

SELECT week_number, company, division, department, firstname, middlename, lastname, suffix, homephone, cell_number, total_point
FROM jos_users, jos_employee, jos_employee_data
WHERE jos_employee.username=jos_users.username AND jos_users.id=jos_employee_data.userid AND jos_employee_data.total_point>34 AND UserID = {$UserID}
ORDER BY jos_employee_data.total_point DESC, jos_employee.lastname ASC

Thanks
The administrator has disabled public write access.
 
#32962
Re:UserID in a complex query 11 Years, 6 Months ago Karma: 748
Hello,

Try to use the following code:

Code:


AND jos_users.id = {$UserId}



instead of your code:

Code:


AND UserID = {$UserID}



Regards,
ARI Soft
The administrator has disabled public write access.
 
#32965
Re:UserID in a complex query 11 Years, 6 Months ago Karma: 0
Great idea, but it didn't work.
The administrator has disabled public write access.
 
#32966
Re:UserID in a complex query 11 Years, 6 Months ago Karma: 748
Set "SQL -> Debug" parameter to "Yes" and check that the query doesn't contain error(s).

If it doesn't help, send SQL dump of the tables which are used in the query by email so we can investigate the problem or provide a temporary access to your J! backend and a link to a page where we can see the problem by email.

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