?
Solved

Wordpress - is there a plugin to interogate a local MS SQL Database?

Posted on 2014-09-17
14
Medium Priority
?
3,240 Views
Last Modified: 2014-10-02
Hi,

I have created a basic Intranet site in WordPress using a number of plugins to include company information, photos, training documents & videos, etc.

Does anyone know of a WordPress plugin that will connect to and query an MS SQL database? We have a SQL 2005 server on site and I would love to be able to retrieve and present information from the various tables/views onto an Intranet page / potentially including a search too.

I've seen a few plugins which allow you to access the mySql database behind Wordpress but nothing that allows you to connect to a separate database.

I look forward to your replies & thanks in advance!

Rob
0
Comment
Question by:robsamuel2k8
[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
  • 6
  • 3
  • 2
  • +2
14 Comments
 
LVL 32

Expert Comment

by:DrDamnit
ID: 40328209
Simply put: no.

The functions that allow WordPress to talk to the MySQL back-end could not be replaced by a plugin.

You'd have to fork WordPress entirely.
0
 

Author Comment

by:robsamuel2k8
ID: 40328446
Hi Michael, I'm not looking to replace the interface between WordPress and MySQL. We have a separate database on an MS SQL Server which I'd like to interrogate via WordPress and display information within the site.

For example, a company directory SQL database on another server and I'd like a Wordpress plugin where I can connect to that separate server and query tables, etc. Nothing to do with the MySQL back-end of Wordpress.
0
 
LVL 32

Expert Comment

by:DrDamnit
ID: 40328461
Oh!

Then I mis-read your question.

The answer, then, is yes you can do this, but no, there is not a ready to go plugin that you can use. You'd have to get a custom one written because your table names, columns, data types, etc are all custom. So, there is not an out-of-the-box solution it there just waiting for you.
0
Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 40328493
Michael's correct in that there isn't a plugin that just connects you to a MS SQL instance and lets you do whatever.  There is, however, a plugin that is meant for external user authentication and you could fork that plugin to do what you are wanting to do:

https://wordpress.org/plugins/external-db-auth-reloaded/

Use that as your jumping off point...
0
 
LVL 32

Expert Comment

by:DrDamnit
ID: 40328543
Having looked at the source, I am not sure that would be a great place to use as a jumping off point. Most of the method of the class are specifically for dealing with user authentication (like generating the hash for user passwords for comparisons).

If he's not doing MSSQL user authentication, he'd have to spend more time removing things that weren't applicable than building the actual plugin. I am assuming that since it is an intranet site, that user authentication is not really necessary since access to the network is controlled by physical access. If it was important, then we could use this, but I think he'd probably / rather use active directory authentication, which (at this point) he's basically recrating sharepoint.

@robsamuel2k8

Can you give us a little more information on what you're trying to do? Does it involve user authentication? Or are you just trying to put some intranet content on an intranet site?
0
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 40328547
Having looked at the source, I am not sure that would be a great place to use as a jumping off point. Most of the method of the class are specifically for dealing with user authentication (like generating the hash for user passwords for comparisons).

The thought was that it integrates a connection sequence for an MS SQL instance into WordPress.  The rest of it would have to go, though.
0
 
LVL 32

Expert Comment

by:DrDamnit
ID: 40328611
Seems like it's the long way around the barn considering these built-in functions, no?

http://php.net/manual/en/ref.mssql.php
0
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 40328937
Depends on if you just want to access the db, in which case happy scripting, or integrate the outside db with the rest of WordPress, in which case a small nightmare of functions awaits you.
0
 
LVL 49

Expert Comment

by:PortletPaul
ID: 40329434
merely some ideas for discussion.

An alternative approach would be to address this through the database. For example if you were using Oracle you could setup a "dblink" inside the database to an external database and from there you can access the external data pretty much as if the tables existed in Oracle. MySQL seems limited in this regard however - but someone else may know more on this.

e.g. http://en.wikipedia.org/wiki/MySQL_DataController which appears to permit access to SQL Server tables inside MySQL. Support for this appears very limited

You might have other "middleware" available to you like Oracle's Golden Gate that could place data into MySQL from SQL Server, or use some other interface type to make the data available in MySQL for delivery through Wordpress.
0
 
LVL 32

Expert Comment

by:DrDamnit
ID: 40329497
in which case a small nightmare of functions awaits you

Amen to that.
0
 
LVL 1

Expert Comment

by:Frans Haesendonckx
ID: 40329800
An Out-of-the-box solution would be to replicate your MSSQL database (or a part thereof) to a MYSQL counterpart (with Apatar for instance).  Then use the Abase plugin for Wordpress to incorporate this content in your pages.

https://wordpress.org/plugins/abase/
0
 

Author Comment

by:robsamuel2k8
ID: 40329836
Thanks for your comments so far, all I want to do is retrieve data from a couple of tables in the SQL DB into a WordPress page.

For example, pulling a table of company contacts onto a page or being able to search on clients based on the name.

I'll have a look at the user-auth plugin but it doesn't sound like what I'd like to do is possible...
0
 
LVL 32

Accepted Solution

by:
DrDamnit earned 1500 total points
ID: 40330293
What you want is possible, but not with a readymade plugin. You'd have to write one yourself or have it written.
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
In this blog post, we’ll look at how using thread_statistics can cause high memory usage.
The purpose of this video is to demonstrate how to reset a WordPress password if you are locked out and cannot reset the password. A typical use would be if you cannot access the email to which WordPress would send the password recovery email to…
The purpose of this video is to demonstrate how to add AdSense Ads to a WordPress Website, and how to set up WordPress to automatically place Ads in Sidebars. This will be demonstrated using a Windows 8 PC. Log into your AdSense account. : Cli…

752 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