Add a date to a CB Field

14 years 7 months ago #110266 by toddfletcher
Replied by toddfletcher on topic Re:Add a date to a CB Field
I just looked at the table in phpMyAdmin and looked at the user rows I've been trying to update in cbSubs. Instead of being NULL they are 0000-00-00. So it seems to be putting something in there, but not the date.

Ideas?

Thanks!
Todd

Please Log in to join the conversation.

14 years 7 months ago #110268 by toddfletcher
Replied by toddfletcher on topic Re:Add a date to a CB Field
Scratch that. I realized that the 0000-00-00 was being inserted if I saved the user profile from the cbSubs User Management, not from the subscription SQL query.

Todd

Please Log in to join the conversation.

14 years 7 months ago #110405 by krileon
Replied by krileon on topic Re:Add a date to a CB Field
toddfletcher wrote:

Scratch that. I realized that the 0000-00-00 was being inserted if I saved the user profile from the cbSubs User Management, not from the subscription SQL query.

Todd


So it's working now?


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.

14 years 7 months ago #110491 by toddfletcher
Replied by toddfletcher on topic Re:Add a date to a CB Field
No. I am still at this point:

I just tried phpMyAdmin and the following worked:

UPDATE `jos_comprofiler` SET `cb_workshop001` = DATE_FORMAT( CURDATE(), '%Y-%m-%d' ) WHERE `user_id` = 66

But then I put the following in cbSubs... and the field is still blank:

UPDATE `jos_comprofiler` SET `cb_workshop001` = DATE_FORMAT( CURDATE(), '%Y-%m-%d' ) WHERE `user_id` = [user_id]

Thoughts?

Todd

Please Log in to join the conversation.

14 years 7 months ago #110501 by krileon
Replied by krileon on topic Re:Add a date to a CB Field
Don't know, it should work. Query looks fine. Try the following:


UPDATE `jos_comprofiler` SET `cb_workshop001` = DATE_FORMAT( CURDATE(), "%Y-%m-%d" ) WHERE `user_id` = [user_id]

OR

UPDATE `jos_comprofiler` SET `cb_workshop001` = DATE_FORMAT( CURDATE(), '%Y-%m-%d' ) WHERE `user_id` = '[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.

Please Log in to join the conversation.

14 years 7 months ago #110555 by toddfletcher
Replied by toddfletcher on topic Re:Add a date to a CB Field
The following works great in my SQL software (ie phpMyAdmin)

UPDATE `jos_comprofiler` SET `cb_workshop001` = DATE_FORMAT( CURDATE(), '%Y-%m-%d' ) WHERE `user_id` = 66

UPDATE `jos_comprofiler` SET `state` = "TX" WHERE `user_id` = 66

But the following doesn't work in cbSubs:

UPDATE `jos_comprofiler` SET `cb_workshop001` = DATE_FORMAT( CURDATE(), '%Y-%m-%d' ) WHERE `user_id` = [user_id]

UPDATE `jos_comprofiler` SET `state` = "TX" WHERE `user_id` = [user_id]

So it almost seems that cbSubs is not passing the user_id. Are there any error logs? Some way to see why it isn't running.

argh.
Todd Fletcher

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.257 seconds