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


Recent Events
  • 23/11/2024 Black Friday 2024

    BIG SALE, 30% discount for all our extensions. Use BF24 coupon code. Hurry up the discount is valid till 3 December.

  • 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.


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?

Hide values from a certain user group
(1 viewing) (1) Guest
Go to bottomPage: 1
TOPIC: Hide values from a certain user group
#22250
Hide values from a certain user group 12 Years, 12 Months ago Karma: 0
Hi,

I have a table that currently displays First Name, Last Name, Role, Email and Phone Number. There are multiple roles including Teacher, Student, Facilitator, etc. What I need is not to display the phone number value of the student in the table if Role is Student, but the table should display the phone numbers of other roles. Is it possible to do? Below is my current query. Thanks, Eric.


SELECT
jos_comprofiler.firstname, jos_comprofiler.lastname, jos_comprofiler.cb_role, jos_users.email, jos_comprofiler.cb_phonenumber FROM `jos_comprofiler`, `jos_users` WHERE jos_users.id = jos_comprofiler.id AND jos_users.usertype = 'Registered'
The administrator has disabled public write access.
 
#22253
Re:Hide values from a certain user group 12 Years, 12 Months ago Karma: 760
Hello,

Try to use the next SQL query:

Code:


SELECT
  jos_comprofiler.firstname, 
  jos_comprofiler.lastname, 
  jos_comprofiler.cb_role, 
  jos_users.email,
  CASE
    WHEN jos_comprofiler.cb_role = 'Student' THEN ''
    ELSE jos_comprofiler.cb_phonenumber
  END AS PhoneNumber
FROM 
  `jos_comprofiler`, 
  `jos_users` 
WHERE 
  jos_users.id = jos_comprofiler.id 
  AND 
  jos_users.usertype = 'Registered' 



Regards,
ARI Soft
The administrator has disabled public write access.
 
#22256
Re:Hide values from a certain user group 12 Years, 12 Months ago Karma: 0
Got it to work. Thanks a bunch.
The administrator has disabled public write access.
 
Go to topPage: 1