[SOLVED] delimiter date if statement

12 years 2 months ago #193655 by tgribble
Replied by tgribble on topic Re: delimiter date if statement
thanks for the reply. i see how this works, but can get it to...

issues:
1. do i use CB Auto Actions or CB Queries? - there is a Querie in Auto Actions. is CB Queries old now? ie CB Auto actions does everything?

2. do i need to create the field cb_memberexpresult to contain the 0 or 1 generated by the Querie?

3. when do i trigger the querie? what we have is a club with "committee members" in the frontend, altering "members" data. if the querie is triggered when "onAfterUserUpdate", will this update the committee member data or the member data that the committee member is altering?

4. when i enter the querie you suggested
SELECT IF( DATEDIFF( `cb_memberexp`, NOW() ) <= 0, 0, 1 ) FROM `#__comprofiler` WHERE `id` = '[user_id]'

it gets shortened down in the CB Auto Actions to
SELECT IF( DATEDIFF( `cb_memberexp`, NOW() ) = '[user_id]' is this normal?

5. does the querie update the sql table? should i see the result in phpmyadmin for the site, or does it not work that way?

thanks

Please Log in to join the conversation.

12 years 2 months ago - 12 years 2 months ago #193748 by krileon
Replied by krileon on topic Re: delimiter date if statement

1. do i use CB Auto Actions or CB Queries? - there is a Querie in Auto Actions. is CB Queries old now? ie CB Auto actions does everything?

Neither you need CB Query Field. It allows performing a database SELECT query and displaying its results as a field. This allows you to use it in your IF substitutions.

2. do i need to create the field cb_memberexpresult to contain the 0 or 1 generated by the Querie?

If that's what you want to name the field yes and no. You don't input anything except for the query. The field calculates the results from the query.

5. does the querie update the sql table? should i see the result in phpmyadmin for the site, or does it not work that way?

It doesn't update anything. It's just a select query.


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 to join the conversation.

12 years 2 months ago #193776 by tgribble
Replied by tgribble on topic Re: delimiter date if statement
excellent - got it working.

thankyou

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.429 seconds

Facebook Twitter LinkedIn