Using update to insert multicheckbox values

12 years 7 months ago #177082 by houfton
Thank you for such an informative reply. I will certainly use ON DUPLICATE KEY UPDATE.

Th script does do a couple of other things including setting up some directories so I am not sure if I can abandon it altogether but I imagine it is not very secure and it certainly seems to have problems with how CB handles fieldtypes (I am using CB1.7).

I ran CB Tools last night to check the database and found all my fieldtype changes gave alarming red warnings. I am ignoring them for now because I have warnings about my MySQL Fields as well which I believe is normal (?) and because it says "fix (adjust)" rather than "FIX NOW!!".

Please Log in to join the conversation.

12 years 7 months ago #177090 by krileon

Thank you for such an informative reply. I will certainly use ON DUPLICATE KEY UPDATE.

Be sure to test thoroughly and please note if it can't provide what you're needing I recommend the second method supplied in my earlier post.

Th script does do a couple of other things including setting up some directories so I am not sure if I can abandon it altogether but I imagine it is not very secure and it certainly seems to have problems with how CB handles fieldtypes (I am using CB1.7).

I recommend ensuring the PHP is as minimal as possible to help avoid issues.

I ran CB Tools last night to check the database and found all my fieldtype changes gave alarming red warnings. I am ignoring them for now because I have warnings about my MySQL Fields as well which I believe is normal (?) and because it says "fix (adjust)" rather than "FIX NOW!!".

It's usually best not to alter database, but if it's working for you then I don't see a problem of doing so at this time. Just keep your changes in mind encase an issue occurs in the future.


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 6 months ago #180598 by houfton
To continue this saga, I have tried to use the CBSubs Import feature to activate users who were entered offline. (I created them as Users first usiing CBJuice.)

Everything works except the SQL action I set up as advised did not perform its queries as it does when using the normal registration process. My php script worked but, because of the problems I described previously, I have had to move most of the database queries into the SQL action.

I tried a simplified test to see if it would work at all but the query was not performed:
UPDATE #__comprofiler SET address = 'test' WHERE id = [user_id];

Are SQL actions not run on CBSubs Import?

Please Log in to join the conversation.

12 years 6 months ago - 12 years 6 months ago #180603 by krileon
All integrations function on import, but if your plan is free lifetime and you've not configured CBSubs to create subscriptions for free lifetime plans most integrations won't do anything.

Wouldn't it be easier to simply execute your queries directly on your database if it's a 1 time change? At any rate your query should be as follows, you're missing quotes.
UPDATE `#__comprofiler` SET `address` = 'test' WHERE `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.

12 years 6 months ago #180612 by houfton
The CB Fields, Email and URL integrations seem to be working fine so there is hope!

It is not a free lifetime plan.

I was hoping to avoid doing separate direct database queries but if this does not work I will have to. Surely the simple thing would be for it all to happen automatically for normal and imported subscriptions?

I have added quotes (back ticks?) though the script did seem to be OK without them with normal registrations. Sadly it made no difference.

I switched debug mode on and encountered this error which might explain things:

Fatal error: Call to undefined method stdClass::store() in /home/guidford/public_html/components/com_comprofiler/plugin/user/plug_cbpaidsubscriptions/plugin/cbsubssqlactions/cbsubs.sqlactions.php on line 112

Do you get this error as well or is it just me?

Please Log in to join the conversation.

12 years 6 months ago #180654 by houfton

Fatal error: Call to undefined method stdClass::store() in /home/guidford/public_html/components/com_comprofiler/plugin/user/plug_cbpaidsubscriptions/plugin/cbsubssqlactions/cbsubs.sqlactions.php on line 112


I am not sure where we are with this. Is this a bug or something wrong with my set up?

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.231 seconds

Facebook Twitter LinkedIn