• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: Get user data using SQL CASE function

Get user data using SQL CASE function 7 years 3 months ago #37857

  • Roberts
  • Roberts's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 54
  • Thank you received: 1
I am trying to auto-complete a text field using CASE but all I am getting is a null value!

My code (in the default value box) is as follows -
//<code>
$db = JFactory::getDBO();
$db->setQuery("SELECT `age` FROM `#_users 
(CASE WHEN `age` < 21 THEN "USER IS OVER 21"
CASE WHEN `age` > 21 THEN "USER IS UNDER 21"
ELSE "USER IS 21"
END);
$result = $db->loadResult();
return $result;
//</code>

Any thoughts as to why this is not working?
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!