我想使用 php 与 IBM netezza 建立数据库连接,但我在互联网上没有找到任何文章。我试图搜索各种文档,但找不到方法,有可能吗?
1 回答
0
1. make sure client is installed
2. install & configure unixodbc driver. (http://www.unixodbc.org/)
(configure odbc.ini & odbcinst.ini with your username, password,databasename)
3. goto php iterative mode. ex. php -a
4. below are php sample code.
php > $connection = odbc_connect(
"DRIVER={NetezzaSQL};Server=localhost;Database=db1",
"user1", "password");
php > $sql = "SELECT 1 as test";
php > $rs = odbc_exec($connection,$sql);
php > odbc_fetch_row($rs);
php > echo "\nTest\n\n” . odbc_result($rs,"test") . “\n";
Test
1
php > odbc_close($connection);
php > exit;
于 2020-06-29T14:29:32.470 回答