Solved

Drupal Module for Interacting with Second Database?

Posted on 2014-09-11
1
201 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

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How would I implement CDN functionality in a custom PHP-based CMS and application? 12 58
Survey branching tutorial 11 44
mysql qry 1 25
if statement malfunction 5 23
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…
Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

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