Foreign Database Integration
nadimo - March 28, 2008 - 03:52
Hello,
Can someone please tell me which modules are used for foreign (custom) database integration ?, If I have a MySql database other than the one created by Drupal and I need to present data allow people to add, view, update, delete records from it , what are the modules suited for this Job ?
Hope someone can help .
Thanks in advance.
Nadimo.

There is a technique for
There is a technique for connecting to different databases. See:
http://drupal.org/node/18429
Or you can put your tables in the same database as Drupal.
In any case, Drupal can't know what is in your tables, so you will need your own SQL queries, either directly in a Drupal node or block or in a module of your own.
Other than this, perhaps you could try to "Drupalify" the concepts of your database data, make them nodes, categories, CCK fields etc, so that you don't have an external database any more. Especially CCK fields can be handy.
Hi, Can anyone please tell
Hi,
Can anyone please tell which drupal database tables need to be filled to get the following information into nodes and vocabulary/taxonomy:
- Subject title -> Node title- Subject body -> Node body
- Subject url -> Node url (links_weblink Url field)
- Metadata decription -> Nodewords description
- Metadata keywords -> Nodewords keywords
- Category 1 -> Taxonomy-term in Vocabulary
- Category 2 -> taxonomy-term in Vocabulary 2
What MYSQL queries do I have to set up, and has somebody done a similar thing already?
Thanks in advance for your reply!
greetings,
Martijn
I wouldn't advise trying
I wouldn't advise trying direct MySQL manipulation for anything but the simplest tasks (like populating a taxonomy vocab or alias table)
You really should instead do some small php scripts that invoke the Drupal APIs.
Get the devel module and see what node structures look like.
Tune your node definitions so the right node object placeholders are ready for your data.
Query your own database and instantiate a node object (just make it up, being sure to include a few basic properties like create time and owner uid)
Run node_save() on your creation.
It's serialized.
Or get a copy of node_import and see if you can create an in-between export/import dump from your data.
Doing it in realtime is of course trickier. Not impossible, but you'll hurt yourself trying to inject raw SQL until you have a handle on the revisions table and sequences table.
You'll be needing to do lookups anyway to retrieve node and term ids to match them up, the DB is normalized.
.dan.
How to troubleshoot Drupal | http://www.coders.co.nz/
Hi Dman or others, I have
Hi Dman or others,
I have looked at node_import, but it can be the case I need 10.000 nodes to insert, and node_import, like importexportapi doesn't handle large amounts of nodes nicely.
Did somebody do already "injection of raw SQL" including handling of revision table and sequence table?
I would be happy to see some code to go from that point further?
greetings,
Martijn