Good Afternoon,

I'm looking to connect to a MSSQL database on an external windows server, I'm creating a PHP script (on a linux server) which will pull data from the database so I can enter into my new MYSQL database. I would also be looking to specify the port number I'm connecting to.

There are loads of code online, but they don't seem to work.

sqlsrv_connect() brings up the folowing error.

I'm just looking for some code which will guarentee to work and then I can see if there is any network issues stopping the connection.

SO PLEASE PASTE CODE YOU KNOW WORKS, Then I can mess around with it.

Thanks,

Shaun

code which will guarentee to work

This depends on your settings. IIRC sqlsrv uses windows authentication by default, which unix won't have. Have you tried mssql_connect instead?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.