Solved

Drupal Module for Interacting with Second Database?

Posted on 2014-09-11
1
187 Views
Last Modified: 2014-09-29
Our Drupal site is to leverage data from a second MySQL database. The conneciton is already in place in settings.php

I'm wondering now if there is a module I can use to interact with it (select, update, etc). Or at least what's the best practice working with SQL queries - GUI with a module, or code?

One goal is to display the results on screen, and allow the User to filter rows and columns.
0
Comment
Question by:sandshakimi
1 Comment
 
LVL 13

Accepted Solution

by:
Arrow_1 earned 500 total points
ID: 40317523
I'm not aware of a specific module that helps you work with multiple databases, but you can certainly access and manipulate that data within your own module using the Drupal's Database API.

This Stack Exchange question addresses accessing the second database.

You can also leverage the Views module for building queries and displaying/filtering content.

This article explains how to build a module that exposes your second database to the Views module. In his example, he uses the hook_views_data() function to describe the database schema to Views. That function is documented here and includes some examples on how to use it. Here are some more Views API references:
https://api.drupal.org/api/views
https://api.drupal.org/api/views/views.api.php/7
https://api.drupal.org/api/views/includes!view.inc/class/view/7
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
This article discusses how to create an extensible mechanism for linked drop downs.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to dynamically set the form action using jQuery.

759 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now