[SOLVED] new user number

14 years 5 months ago #113615 by iapmo
[SOLVED] new user number was created by iapmo
hello,

im currently trying to get a number from one database into my joomla table.

here is the setup.

I have added a field called 'cb_membernumber' which is supposed to be updated from another Database table. I have successfully connected to the outside database and have placed the new number into a variable. I have also been able to display this variable to make sure it is working.

My issue occurs when trying to get this new variable to update into Joomla's cb table.

basically what I did was create a new function which sets the outside db number to a variable within joomla.

But when I try to pass this new number into my new cbsubs field it does not work. first I tried to set the variable by using the plan integrations and SQL command to throw in the variable but only got the variable name not the variable.

next i tried to hard code the sql statment within the code that retrives the variable which also did not work.

help!

[code:1]
//UPDATE THE CBSUBS TABLE WITH NEW MEMBER NUMBER INFORMATION FROM outside DBTABLE
$query = "UPDATE ".$_CB_database->nameQuote('#__comprofiler')."
SET ".$_CB_database->nameQuote('#__comprofiler').".".$_CB_database->nameQuote('cb_membernumber')." = $MemberNumber
WHERE ".$_CB_database->nameQuote('#__comprofiler').".".$_CB_database->nameQuote('user_id')." = [user_id]"; [/code:1]

Post edited by: krileon, at: 2009/10/22 14:50

Please Log in to join the conversation.

14 years 5 months ago #113623 by krileon
Replied by krileon on topic Re:new user number
This is now how SQL Actions are structured. Please review this example thread of SQL Actions usage.

I suggest you use CBSubs URL to execute a code file to handle your integration, you can then execute any code you see fit.


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 5 months ago #113631 by iapmo
Replied by iapmo on topic Re:new user number
Thank you for the reply...

I checked out that thread but none of the examples in it are setting a field to a variable. I am also unfamiliar with CBSubs URL which I guess would be to run the script function which sets the variable from the Outside Database. I have everything running properly by just adding a function to comprofiler.php file which first sets the variable from the outside DB and places that data into my CBSubs table. My only problem now is that I only want this function to run after paid subscription not just registration. Currently I have my new function running when the function 'saveRegistration()' is hit.

If I can pull these functions out of the comprofiler.php file and place them into my own file that is run at subscription save that would be okay too.

Please Log in to join the conversation.

14 years 5 months ago #113635 by iapmo
Replied by iapmo on topic Re:new user number
Okay now this is what I have.


function in comprofiler.php which sets the outside db variable to $GLOBALS when user registers.

SQL ACTION INTEGRATION:

UPDATE jos_comprofiler
SET cb_membernumber = $GLOBALS
WHERE user_id = [user_id]


Doesn't work. Any other ideas?

Please Log in to join the conversation.

14 years 5 months ago #113695 by krileon
Replied by krileon on topic Re:new user number
You're wanting a complex PHP query. Use CBSubs URL to execute a code file to do as you're asking. Write a file to do any necessary queries and run any necessary code. You can then execute it with CBSubs, however I am still unsure if you're going to be able to access the globals. Substitutions is supported, but variables are not.


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 5 months ago #114818 by iapmo
Replied by iapmo on topic Re:new user number
Thanks krileon,

I have three subscriptions, two paid and one free for life...

the URL integration is currently working for both paid subscriptions. one script connects to outside db for stuff, and the second is supposed to copy the CB table info over to VM. It works with the paid subscriptions.

With the free subscription this simply isn't working, same file but different result.

Any ideas?

thanks.

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.214 seconds