Skip to Content.
Sympa Menu

freetds - Re: [freetds] PHP, PDO dsn-less connection to MS-SQL 2008

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Cesare Leonardi <celeonar AT gmail.com>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] PHP, PDO dsn-less connection to MS-SQL 2008
  • Date: Sun, 11 Dec 2011 15:37:45 +0100

On 11/12/2011 08:14, Andreas wrote:
Hi,
can someone help me with PHP, PDO dsn-less connection to MS-SQL 2008,
please?

This is the connection string i'm currently using to connect to MSSQL 2000 with FreeTDS 0.91 and without any external conf file:

$dbDriver = "FreeTDS; TDS_Version=7.1; port=1433";
$dbh = new PDO("odbc:Driver=$dbDriver; Server=$serverFQDN; Database=$dbName; Uid=$usr; Pwd=$pwd;");

IIRC, after the upgrade to 0.91, i were not able to connect until i've explicity specified the port= parameter.

Cesare.




Archive powered by MHonArc 2.6.24.

Top of Page