Skip to Content Skip to Menu

🎃 Happy Halloween! Treat yourself with an awesome discount on memberships! Get 20% off now with code SPOOKY-2024!

[SOLVED] how to ensure the result of the query

  • mfe13
  • mfe13
  • OFFLINE
  • Posts: 572
  • Thanks: 26
  • Karma: 5
11 years 4 months ago - 11 years 4 months ago #229182 by mfe13
hello,
how to ensure the result of the query is usable but not displayed ?
Query :
Code:
SELECT viewer_id FROM #__comprofiler_views WHERE profile_id=[user_id] AND DAY(NOW()) - DAY(lastview) < 3 AND viewer_id!=0 ORDER BY lastview DESC LIMIT 3
Raw :
Code:
[column_viewer_id],
In front Page :
Result (ok)+ 2625,48,2642,This is what I want to hide
Last edit: 11 years 4 months ago by krileon.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48464
  • Thanks: 8280
  • Karma: 1443
11 years 4 months ago #229199 by krileon
Replied by krileon on topic how to ensure the result of the query
You want to hide the last comma? Nope, your best approach is to adjust your query and have your query automatically delimiter it for you. Below usage should provide you with what you're wanting.

Query:
Code:
SELECT GROUP_CONCAT( DISTINCT `viewer_id` SEPARATOR ', ' ) FROM `#__comprofiler_views` WHERE `profile_id` = '[user_id]' AND ( DAY( NOW() ) - DAY( `lastview` ) ) < 3 AND `viewer_id` != 0 GROUP BY `profile_id` ORDER BY `lastview` DESC LIMIT 3
Output: Single Row
Columns: Single Column


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.

Please Log in or Create an account to join the conversation.

  • mfe13
  • mfe13
  • OFFLINE
  • Posts: 572
  • Thanks: 26
  • Karma: 5
11 years 4 months ago #229235 by mfe13
Replied by mfe13 on topic how to ensure the result of the query
Hello

I have 2 fields, 1 query and 1 delimiter.
I use the result of the query field to show a picture or one else.

Is it possible to hide the result of the query's field on the front but use
it for the other field ?

Or show me, please, how can I do ?

thanks

Please Log in or Create an account to join the conversation.

  • nant
  • nant
  • OFFLINE
  • Posts: 12339
  • Thanks: 1467
  • Karma: 877
11 years 4 months ago #229243 by nant
Replied by nant on topic how to ensure the result of the query

geniusyourself wrote: Hello

I have 2 fields, 1 query and 1 delimiter.
I use the result of the query field to show a picture or one else.

Is it possible to hide the result of the query's field on the front but use
it for the other field ?

Or show me, please, how can I do ?

thanks


If you put your query field in a tab that is published for Admin view only, then your users will not see it in frontend, but you should be able to use it in delimiter fields.

Please Log in or Create an account to join the conversation.

  • mfe13
  • mfe13
  • OFFLINE
  • Posts: 572
  • Thanks: 26
  • Karma: 5
11 years 4 months ago #229262 by mfe13
Replied by mfe13 on topic how to ensure the result of the query
Ok, it works ;)
Thanks

Please Log in or Create an account to join the conversation.

  • mfe13
  • mfe13
  • OFFLINE
  • Posts: 572
  • Thanks: 26
  • Karma: 5
11 years 4 months ago #229314 by mfe13
Replied by mfe13 on topic how to ensure the result of the query
Hello,

I still need you ...(and always!) ;)

Everything works fine, so I create a field if there were visits profile the last 3 days.
But I also want to add the number of visits for the same period. How please?
thank you

thank you

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum