- Posts: 4
- Thank you received: 0
Dynamic Parameter in SQL CUSTOM FIELD
- Martin Breza
- Topic Author
- Offline
- New Member
Less
More
2 years 11 months ago - 2 years 11 months ago #143268
by Martin Breza
Dynamic Parameter in SQL CUSTOM FIELD was created by Martin Breza
Hello,
from your documentation following SQL statement can be used to populate SQL Custom Field:
Is it possible to use variables in WHERE condition? Preferably USER ID or MEMBERSHIP ID? Something like this:
Thank you,
Martin
from your documentation following SQL statement can be used to populate SQL Custom Field:
Code:
SELECT name AS value, name AS text FROM table WHERE published = 1 ORDER BY name
Is it possible to use variables in WHERE condition? Preferably USER ID or MEMBERSHIP ID? Something like this:
Code:
$user = JFactory::getUser();
$userId = $user->get('id');
SELECT name AS value, name AS text FROM table WHERE UserId = {$userId}
Thank you,
Martin
Last edit: 2 years 11 months ago by Martin Breza.
Please Log in or Create an account to join the conversation.
- Tuan Pham Ngoc
- Away
- Administrator
2 years 11 months ago #143269
by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Dynamic Parameter in SQL CUSTOM FIELD
Hi Martin
No, it is not possible at the moment. Please note that use something like:
$user = JFactory::getUser();
is not right. The reason is because the field not only being displayed for user but also when admin view/edit the subscription record, so use current user ID like that is not right
Tuan
No, it is not possible at the moment. Please note that use something like:
$user = JFactory::getUser();
is not right. The reason is because the field not only being displayed for user but also when admin view/edit the subscription record, so use current user ID like that is not right
Tuan
Please Log in or Create an account to join the conversation.
- Martin Breza
- Topic Author
- Offline
- New Member
Less
More
- Posts: 4
- Thank you received: 0
2 years 11 months ago #143285
by Martin Breza
Replied by Martin Breza on topic Dynamic Parameter in SQL CUSTOM FIELD
Hi Tuan,
I believe I've finally find exactly what I need. I will try to use PHP Script plugin ( joomdonation.com/forum/membership-pro-ge...membership-card.html ).
Thank you,
Martin
I believe I've finally find exactly what I need. I will try to use PHP Script plugin ( joomdonation.com/forum/membership-pro-ge...membership-card.html ).
Thank you,
Martin
Please Log in or Create an account to join the conversation.
- Tuan Pham Ngoc
- Away
- Administrator
2 years 11 months ago #143286
by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Dynamic Parameter in SQL CUSTOM FIELD
Great. But please note that the script plugin is only executed after subscription store, active or expired
It has nothing with SQL custom fields.
Tuan
It has nothing with SQL custom fields.
Tuan
Please Log in or Create an account to join the conversation.
- Joshua Goldberg
- Offline
- Junior Member
Less
More
- Posts: 27
- Thank you received: 0
2 years 8 months ago #145980
by Joshua Goldberg
Replied by Joshua Goldberg on topic Dynamic Parameter in SQL CUSTOM FIELD
Hi Martin,
Did you get this working?
Kind regards,
Josh
Did you get this working?
Kind regards,
Josh
Please Log in or Create an account to join the conversation.
Support
Documentation
Information
Copyright © 2024 Joomla Extensions by Joomdonation. All Rights Reserved.
joomdonation.com is not affiliated with or endorsed by the Joomla! Project or Open Source Matters.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.