PHP ODBC Connection
| From: | jacques charlery | Date: | Mon, 20 Aug 2001 10:15:49 +0000 |
| Subject: | PHP ODBC Connection | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-11539@lists.php.net to get a copy of this message | ||
Hi everybody, I'm new to PHP4 and I'm trying my first connection to an
odbc database.
I'm using RedHat 7.0, PHP 4.0.1pl2, and unixODBC to connect via ODBC to
MSSQL running on Windows NT. I've been able to correctly configure
unixODBC with easysoft's odbc to odbc bridge.
I've created an ms-sql file and run this php file
<?php
putenv("LD_LIBRARY_PATH=/usr/local/lib");
putenv("ODBCINSTINI=/usr/local/etc/odbcinst.ini");
putenv("ODBCINI=/usr/local/etc/odbc.ini");
$dsn="oobclient"; // this is a valid DSN, can be tested in odbctest
$user="****";
$password="****";
$conn_id = odbc_connect($dsn,$user,$password);
if ($conn_id)
echo "connected to DSN: $dsn";
else echo "Connection impossible";
?>
Warning: SQL error: , SQL state in SQLConnect in
/var/www/html/testodbc.php on line 14
Connection impossible
Do I have to enable something ?