Connection via PHP to a SQL Server 2012 database

1

My problem has some variants:

  • I have a website built on joomla, which is hosted on a linux server.
  • The administrator where I have hosted my website, has informed me that will not install any php extension, so as not to get conflicts or problems on the server
  • The php module does not contain any connection extension to Sql server (eg, sqlsrv, mssql)
  • I have a C # program, and my database is stored in Amazon (SQL Server 2012)

To summarize, I need my site to be able to connect to my Sql Server 2012 database in my program to display the information I have on the website, and to add new information, change it, etc.

If anyone knows how to make the same connection, given the variables to which I am subject, thank you immensely.

    
asked by anonymous 05.06.2014 / 16:44

1 answer

1

If on your host you are limited to the extensions, I would solve this using normal PHP to connect to a service exposed in Amazon.

It would be a WebAPI made on top of the SQL database, that PHP could then send HTTP calls to it and get the data in XML or JSON. So you can POST to create new records, PUT to make updates, DELETE to delete, and GET to select.

It is a fairly common methodology, called Data Access Layer (DAL) or API (Application Programming Interface).

    
06.06.2014 / 01:07