?
Solved

Drupal Module for Interacting with Second Database?

Posted on 2014-09-11
1
Medium Priority
?
231 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:
Aaron Feledy earned 2000 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

Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

Question has a verified solution.

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

By, Vadim Tkachenko. In this article we’ll look at ClickHouse on its one year anniversary.
In this blog post, we’ll look at how using thread_statistics can cause high memory usage.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

770 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