Solved

Drupal Module for Interacting with Second Database?

Posted on 2014-09-11
1
205 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When table data gets too large to manage or queries take too long to execute the solution is often to buy bigger hardware or assign more CPUs and memory resources to the machine to solve the problem. However, the best, cheapest and most effective so…
This post looks at MongoDB and MySQL, and covers high-level MongoDB strengths, weaknesses, features, and uses from the perspective of an SQL user.
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 create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

726 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