I have a field which I want to display dependent on the value on another field.
The first field is a delimiter type
The field that it depends on is a query type
The query is:
SELECT FLOOR(points) FROM wxo_alpha_userpoints WHERE wxo_alpha_userpoints.userid = [user_id]
The condition for the second field is:
cb_buzzerpoints > 10000
It works in most case but in some, when accessing certain profile pages I get the error:
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 '[user_id]' at line 1 SQL=SELECT FLOOR(points) FROM wxo_alpha_userpoints WHERE wxo_alpha_userpoints.userid = [user_id]
It seems that the substitution is not working for some profile pages.
In most cases, whether the points total is below or above 10000, the first field shows or not when it should do.
Your query has no escaping. All substitutions are string, but your usage is treating it like an integer. Please try the below query.
Code:
SELECT FLOOR( `points` ) FROM `#__alpha_userpoints` WHERE `userid` = '[user_id]'
Kyle (Krileon) Community Builder Team Member Before posting on forums:
Read FAQ thoroughly
+
Read our Documentation
+
Search the forums CB links:
Documentation
-
Localization
-
CB Quickstart
-
CB Paid Subscriptions
-
Add-Ons
-
Forge
-- If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
-- If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please
send me a private message
with your thread and will reply when possible!
-- Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
-- My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.