-
- if ($conn=OCILogon("kai","fjelite","linux"))
- { echo "SUCCESS ! Connected to database/n";
- }
- else
- {echo "Failed :-( Could not connect to database/n";}
- $stmt = OCIParse($conn,"select tel,AREA from hkh_tel ");
- OCIDefineByName($stmt,"TEL",&$TEL);
- OCIDefineByName($stmt,"AREA",&$AREA);
- OCIExecute($stmt);
- while
- ( // bbs.it-home.org
- OCIFetch($stmt))
- {
- echo "TEL:".$TEL."/t";
- echo "AREA:".$AREA."/n";
- }
- OCIFreeStatement($stmt);
- OCILogoff($conn);
- ?>
-
复制代码
2,加上执行权限:
-
- chmod 755 /var/www/html/conn_ora.php
-
复制代码
3,本地调试:
-
- /usr/bin/php /var/www/html/conn_ora.php
复制代码
>>> 您可能感兴趣的文章:
php连接Access数据库的方法小结
php连接access数据库的三种方法
php ADO组件连接access数据库的例子
php连接数据库的简单例子
有关php连接mssql的一些总结
分享一个PHP连接sql server的类
PHP连接mssql数据库
|