Source: barryvanveen.nl

Connect to MSSQL database from PHP

Category: Laravel, Laravel, PHP, PHP

Last couple of months I've been working on a project that relies heavily on a Microsoft SQL (or mssql) database. It is the source of a legacy system that we are currently replacing.

Start by installing the http://www.freetds.org/ database driver with the following commands: sudo apt-get update sudo apt-get install freetds-common freetds-bin php-sybase

Add a new configuration to the end of file: [myhostname] host = myhostname.com port = 1433 tds version = 7.1 client charset = UTF-8

You can read more about the TDS configuration file in the http://www.freetds.org/userguide/freetdsconf.htm.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners