TOPIC:

Integrator and sql code 2 weeks 5 days ago #257802

  • Topic Author
  • tomduda
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 5
  • Thanks: 0
Hello,
I'd like to get an advice for following scenario:
I have form with 2 text fields, which are distributed into 2 different tables via Integrator. So far so good. After the Integrator inserts the data, 2 different IDs in the tables are assigned to new rows.
Now, within the same submission of the form, I need to find out the ID given in first table (SELECT id FROM table1 WHERE column1='textfield1_content' AND column2='textfield2_content') and update it in column of the second table.

So far I have these ideas:
Option 1:
Integrator's Rule1 which inserts data into first table
Integrator's Rule2 which inserts data into second table
Integrator's Rule3 which updates referring ID in second table with ID's value returned by query above (I guess the query must be constructed in Code section of the Integrator mapping)

Option 2:
Integrator's Rule1 which inserts data into first table
Integrator's Rule2 (update type) which inserts data into second table and updates the referring ID by querying first table (as above)

Questions:
How do I construct the SQL query with values submitted in the form?
How do I ensure that first rule is executed before the second (which has to find the already existing ID)?
Are there any other options?

Thank you

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

Last edit: Post by tomduda.

Integrator and sql code 2 weeks 5 days ago #257804

  • Topic Author
  • tomduda
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 5
  • Thanks: 0
Sorted out with MySQL triggers.

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

  • Page:
  • 1
Moderators: ForumSupport
Time to create page: 0.032 seconds

BreezingForms Pro 1.4.7 for WordPress Released!

Available in the membership section.

September Discount!

Massive discounts on all subscriptions!

Get Your Subscription Here

Quick Links

Downloads

BreezingForms

ContentBuilder

BreezingCommerce

Templates

Documentation

BreezingForms

ContentBuilder

BreezingCommerce

Apprendre BreezingForms (French Community)

Apprendre et maîtriser BreezingForms par des tutoriels et exemples, le tout en français

breezingforms.eddy-vh.com

Questions et réponses sur les forums de l'AFUJ

AFUJ

Special Offer

Summer Sale! All subscriptions at a special price!

Includes prio support, all of our current and future Joomla!® extensions and Joomla!® templates for the duration of your membership.

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!