Env Var ???? (With iODBC vs MS-SQL instead of DB2)
| From: | Scott Fletcher | Date: | Fri, 28 Sep 2001 17:07:14 +0000 |
| Subject: | Env Var ???? (With iODBC vs MS-SQL instead of DB2) | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-12826@lists.php.net to get a copy of this message | ||
Hi!
I had PHP compilied successfully with the "--iodbc=/usr/local/odbcsdk/"
option. I'm using AIX 4.3.3 and it have IBM DB2 v6.1 on it. I'm using
apache as well. One of hte website use the db2 which is not a problem. I
use the other website that point to MS-SQL Server which is a different
machine. This is where I get interesting problem.
When I use the odbctest, it work fine without a problem and was able to
point to the MS-SQL Server. But when I use the PHP, it doesn't point to
MS-SQL Server, instead it point to DB2 on this machine. How do I make PHP
get it's attention off of DB2 and instead focus on the MS-SQL Server. Could
the problem be the Env Var?
-- clip begin --
putenv("LD_LIBRARY_PATH=/usr/local/odbcsdk/lib/oplodbc.so.1");
putenv("LIBPATH=/usr/local/odbcsdk/lib/oplodbc.so.1");
putenv("ODBCINSTINI=/usr/local/odbcsdk/doc/odbcinst.ini");
putenv("ODBCINI=/usr/local/odbcsdk/doc/odbc.ini"); l
$connect=odbc_connect("DP_KB_1","sa","") or die("Unable to
connect to
Database !!!");
$ask="SELECT * FROM CLIENT WHERE APPLICATION='DP' AND
ACTIVE='1'";
$result=odbc_exec($connect,$ask);
@odbc_result_all($result, "BGCOLOR='#FFFFFF' border='1'
bordercolor='#000000'");
@odbc_close($connect);
-- clip end --
Thanks,
Scott