Pulling and updating data from DB

Posted on 2013-06-11
Medium Priority
Last Modified: 2013-06-26
Hello Drupal Experts,

How can I use data in content types from another content type and have that data updated?  I have one content type that I would enter a float ($1,000.00).

I would like for other content types to get that float value and then perform calculations within an other content type. Once saved, the ($1,000) is changed and can be used elsewhere...if needed.

Content Type: Enter Money
Float textfield: (moneyEntered=$1000)

Content Type :  Adjust Money
Float textfield:  (from moneyEntered)
Float textfield:  (moneyAdjusted=$500)

So now the moneyEntered value=$1500 and it can be used in other content types as needed.

Thank for any help.
Question by:Modifier1000
  • 2
  • 2
LVL 10

Expert Comment

ID: 39238377
Hmmm, strange stuff you're doing there.

I don't think I can solve that for you but the computed field module may be of use:

Also, I'm not sure of your end goal but maybe a more real time calculation would be a better idea, i.e. take the same fields from each node and do a calculation on them using the views calc module:

Perhaps a single node for all this and the field_permissions module?

If you let me know your higher level goal, maybe I can suggest a better approach.


Author Comment

ID: 39238513
Thank you, maybe my diagram will help better explain.
LVL 10

Accepted Solution

oliverpolden earned 2000 total points
ID: 39238785
That doesn't describe what you are trying to achieve. That describes a possible solution.

Why do you have separate content types for account adjustments and account balance and why do you need to update different nodes?

Have you come across the views module? It's very versatile and allows you view and manipulate multiple nodes in different ways:

If however that is what you really need to do then you will probably need to create your own module to act on nodes when they are saved and updated.

Here's some info about how to react to node actions:


Author Closing Comment

ID: 39279460
Thank you!

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

This article is for those that are having major problems with users upload files such as pictures to their profile. The solution is simple and has to do with correcting the directory paths. With some experimenting and testing i got it fixed. Note…
This article shows how a content item can be identified directly or through translation of a navigation type. It then shows how this information can be used to create a menu for further navigation.
If you are looking for an automated solution for backup single or multiple Office 365 user mailboxes to Outlook data file, then you can use Kernel Office 365 Backup & Restore tool. Go through the video to check out the steps to backup single or mult…
From store locators to asset tracking and route optimization, learn how leading companies are using Google Maps APIs throughout the customer journey to increase checkout conversions, boost user engagement, and optimize order fulfillment. Powered …

586 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question