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

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
Rob SamuelIT ManagerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

DrDamnitCommented:
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
Rob SamuelIT ManagerAuthor Commented:
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
DrDamnitCommented:
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
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Jason C. LevineNo oneCommented:
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
DrDamnitCommented:
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
Jason C. LevineNo oneCommented:
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
DrDamnitCommented:
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
Jason C. LevineNo oneCommented:
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
PortletPaulfreelancerCommented:
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
DrDamnitCommented:
in which case a small nightmare of functions awaits you

Amen to that.
0
Frans HaesendonckxFreelance ConsultantCommented:
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
Rob SamuelIT ManagerAuthor Commented:
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
DrDamnitCommented:
What you want is possible, but not with a readymade plugin. You'd have to write one yourself or have it written.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
WordPress

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.