Link to home
Start Free TrialLog in
Avatar of ROM
ROMFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Joomla using ODBC or MSSQL conn to MSSQL other db

Hi All,

Please advise on the best way in a module to select query from a MSSQL db.
I have enabled ODBC etc... in PHP settings.
Have setup the DSN.
Not having much joy at all. Can query MySQL DB's of course .. but do not think I can get MSSQL to work.
Possibly I am missing an extension.

Do not want to post any code as I have tried all sorts.
I am happy with the Select.. just need to get the MSSQL connection right.

Would like to see an example I can drop into my custom extension within a module.

PHP 7.3.9
Joomla 3.9.12
Plesk 17.8.11
OS: Windows 2016.

Many thanks in advance

R
Avatar of lenamtl
lenamtl
Flag of Canada image

Hi,

From https://docs.joomla.org/J3.x:Global_configuration/it
Current versions of Joomla can operate on MySQL, MSSQL and PostgreSQL.

Instructions from their documentation
https://docs.joomla.org/Configuring_sqlserver
Avatar of ROM

ASKER

No this is not what I was asking.

I am looking to have an existing Joomla MySQL installation with a custom module I have made to look up values in a MSSQL database.
This is where I am stuck. I can work with the MySQL no problem with my custom Select's etc... but I have an issue changing the source to the MSSQL. Possibly I am using the wrong the method for querying the data.

Please advise.

R
Hi,

What you can do is to lookup in MSSQL using AJAX and RESTFUL.

This allow for example to have a Joomla PHP MYSQL DB and get data from another system server / MSSQL DB
that may be located on another server

You will need know how to query the MSSQL.
You will need to know how AJAX / REST is working

You can hire a dev or use Fiverr freelancer.
Avatar of ROM

ASKER

Thanks for the reply.
Can you explain and give an example how I could do this within a Native Joomla Module using PHP and possibly odbc_connect etc...?

Thanks in advance

R
Hi,

Depending of the plugin there are some extension that you can use
So I would start from that
https://extensions.joomla.org/extension/rest-api/
https://extensions.joomla.org/extension/capi-core-rest-api/
Avatar of ROM

ASKER

No I meant using a self created module.
I just want to clarify why my odbc_connect although verifies it gets a resource, fails when I try to query.
I don't want to use rest etc...
Can you help with doing it this way?

Thanks in advance.

R
Hi,

-Can you clarify the actual DB use for Joomla is MySQL and you want to use MSSQL for only that custom module.
-Is this involve other session, like you are trying to connect to another application that require a session too?
-Does MSSQL DB is on the same server of your actual Joomla installation?

You probably wont have the choice and use an API, bridge...
Joomla have several bridge available that can connect to other existing (well known) application.
ASKER CERTIFIED SOLUTION
Avatar of ROM
ROM
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial