----- Original Message ----- From: "Drewfus" <drewfus@xxxxxxxxx> To: <php-db@xxxxxxxxxxxxx> Sent: Tuesday, February 13, 2007 5:08 PM Subject: unixODBC + PHP 4.4.4 > Hi, > > I've installed unixODBC with the EasySoft ODBC Driver and have connectivity > working to my MS-SQL Server fine. I can login with the iSQL tool and > perform queries without issue - I then moved onto recompiling PHP/Apache > with unixODBC support, but when testing it I see: > > *Fatal error*: Call to undefined function: odbc_connect() > > The PHP script is pretty basic: i do believe the odbc on your comp are not configure yet. another problem may cause from ODBC library (php) for oracle.. u can connect without using odbc (since oracle have own library) i suggest you search for the library (odbc) if you don't use oracle (i read below) or perhaps u search for oracle libary instead odbc.. > <?php > putenv("ODBCINI=/etc/odbc.ini"); > putenv("ODBCINSTINI=/etc/odbcinst.ini"); > putenv("LD_LIBRARY_PATH=/usr/local/easysoft/unixODBC/lib"); i don't think above is necessary.. since the default PHP must already connect to the odbc.. > > $Conn= odbc_connect ("db","user","pass") > or die ("Can't open ODBC-DSN"); > $Rec = odbc_exec ( $Conn, "select * from viewDB") > or die ("Can't execute QUERY"); > > echo "Records returnd : ".odbc_num_rows($Rec)."<br>\n"; > echo "<br>\n"; > ?> > > I verified that during the configure, With unixODBC Support was showing up > as Yes, also there were no compile errors whatsoever. When I check > phpinfo() - I see the following configure command: > > './configure' '--with-png-dir=/usr/local/lib' > '--with-zlib-dir=/usr/local/lib' '--with-gd' > '--with-apache=../apache_1.3.27' > '--with-unixODBC=shared,/usr/local/easysoft/unixODBC' '--without-mysql' > '--with-oracle=/u01/OraHome1' '--with-oci8=/u01/OraHome1' > > The build date is updated with today's date, and the Oracle connectivity > still works - any ideas on why odbc_connect would be an undefined function > with that configure command? > > Thanks, > -D > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php