[freetds] PHP and DSN-less Connection Strings

Joerg Behrens behrens at takenet.de
Fri Mar 18 03:32:45 EST 2005


----- Original Message ----- 
From: "Jon Doblados" <jon.doblados at gmail.com>
To: <freetds at lists.ibiblio.org>
Sent: Friday, March 18, 2005 9:17 AM
Subject: [freetds] PHP and DSN-less Connection Strings


> Gurus,
>
> I have only recently shifted to GNU/Linux and I'm still trying to
> learn the ropes, so please bear with me. Can someone help me with a
> step-by-step guide on how to get freetds running with PHP, preferably
> without changing much of the code (currently using DSN-less connection
> string)? On my SUSE server, I unpacked and installed freetds-0.62.4;
> and by using tsql, confirmed that I am able to connect to SQL Server
> 7. However, I get the error: "Call to undefined function
> odbc_connect..."

That means your php version is build without ODBC support or the extension isnt loaded during
startup. Most current Linux distributions use shared extensions which can be enabled in the php.ini
or loading during runtime with the dl('foo.so') function.

extension_dir= /path/to/extensions
extension=foo.so

But have you read www.php.net/mssql before starting using ODBC? PHP have mssql support based on
freetds. I gives you a bunch of functions like http://www.irixworld.net/php/overview.php?ext=mssql.
To check if the extensions available run a phpinfo() and search for the mssql info table. An example
can found under http://www.irixworld.net/ (search for mssql).

regards
Joerg


-- 
TakeNet GmbH   Mobil: 0171/60 57 963
D-97080 Wuerzburg  Tel: +49 931 903-2243
Alfred-Nobel-Straße 20  Fax: +49 931 903-3025




More information about the FreeTDS mailing list