- Posts: 131
- Thank you received: 0
Executing the SQL statement in a Members list menu item
- Peter Bibb
- Topic Author
- Offline
- Premium Member
-
Less
More
2 years 9 months ago #152764
by Peter Bibb
Executing the SQL statement in a Members list menu item was created by Peter Bibb
Hi Tuan,
We want to run a number of bespoke SQLs to provide lists of members along the lines of:
SELECT * FROM `liv_osmembership_field_value` WHERE `field_id` = 37 AND `field_value` CONTAINS "Ice Creams"
It appears that the Menu item screen is truncating the statement because we get the following message: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT * FROM `#__osmembership_field_value` WHERE `field_id` = 37 AND `field_v' at line 5.
Are we doing something wrong?
Thanks
Peter
We want to run a number of bespoke SQLs to provide lists of members along the lines of:
SELECT * FROM `liv_osmembership_field_value` WHERE `field_id` = 37 AND `field_value` CONTAINS "Ice Creams"
It appears that the Menu item screen is truncating the statement because we get the following message: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT * FROM `#__osmembership_field_value` WHERE `field_id` = 37 AND `field_v' at line 5.
Are we doing something wrong?
Thanks
Peter
Please Log in or Create an account to join the conversation.
- Tuan Pham Ngoc
- Offline
- Administrator
-
2 years 9 months ago - 2 years 9 months ago #152775
by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Executing the SQL statement in a Members list menu item
Hi Peter
The SQL command you are using does not look right to me. Could you change it to :
Then check to see if it works ?
Tuan
The SQL command you are using does not look right to me. Could you change it to :
Code:
tbl.id IN (SELECT subscriber_id FROM `liv_osmembership_field_value` WHERE `field_id` = 37 AND `field_value` LIKE "%Ice Creams%")
Then check to see if it works ?
Tuan
Last edit: 2 years 9 months ago by Tuan Pham Ngoc. Reason: Update SQL command
The following user(s) said Thank You: Peter Bibb
Please Log in or Create an account to join the conversation.
- Peter Bibb
- Topic Author
- Offline
- Premium Member
-
Less
More
- Posts: 131
- Thank you received: 0
2 years 9 months ago #152777
by Peter Bibb
Replied by Peter Bibb on topic Executing the SQL statement in a Members list menu item
Thank you, this works perfectly, well done and thanks for the speedy service!
Please Log in or Create an account to join the conversation.
- Tuan Pham Ngoc
- Offline
- Administrator
-
2 years 9 months ago #152778
by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Executing the SQL statement in a Members list menu item
You're welcome. Happy to hear that it helped
Please Log in or Create an account to join the conversation.
Moderators: Tuan Pham Ngoc
Support
Documentation
Information
Copyright © 2025 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.