php 与 oracle11g 基本操作
来源:互联网 发布:剑三怎么导出脸型数据 编辑:程序博客网 时间:2024/05/21 07:26
数据表,sequence,触发器创建:http://blog.csdn.net/e421083458/article/details/8944164
<?php$conn = oci_connect('SCOTT', 'TIGER', '192.168.1.244:1521/orcl'); // 建立连接if(!$conn){$e = oci_error();print htmlentities($e['message']);exit;}//查询数据$query = 'select * from EXAMPLE order by id desc';$rs = oci_parse($conn,$query);if(!$rs){$e = oci_error($conn);print htmlentities($e['message']);exit;}$result = oci_execute($rs,OCI_DEFAULT);if(!$result){$e = oci_error($result);echo htmlentities($e['message']);exit;}//打印执行结果print '<table border="1">';while($row = oci_fetch_array($rs, OCI_RETURN_NULLS)) {print '<tr>';foreach($row as $item){print '<td>'.($item?htmlentities($item):'').'</td>';}print '</tr>';}print '</table>';//插入数据方式一:$query = "INSERT INTO EXAMPLE(name,phone,address)values('1111','22222','444444')";$rs = oci_parse($conn,$query);$t1 = xdebug_time_index();for($i=0;$i<1;$i++){oci_execute($rs);//默认方式直接上传}$t2 = xdebug_time_index();print ($t2-$t1);//插入数据方式二:$query = "INSERT INTO EXAMPLE(name,phone,address)values('1111','22222','444444')";$rs = oci_parse($conn,$query);$result = oci_execute($rs,OCI_DEFAULT);//默认方式直接上传print_r($result);if(!$result){oci_rollback($conn);oci_close($conn);}oci_commit($conn);oci_close($conn);?>
- php 与 oracle11g 基本操作
- php与oracle11g经典分页
- php mongodb 基本操作
- php redis 基本操作
- PHP 数据库基本操作
- php--array基本操作
- PHP图形基本操作
- php数组基本操作
- PHP--数据库基本操作
- centos7下oracle11g详细的安装与建表操作
- PHP文件系统基本操作类
- PHP中数据库基本操作
- PHP中字符串基本操作
- PHP 日期时间基本操作
- PHP 文件的基本操作
- php curl基本操作详解
- php curl基本操作详解
- PHP 连接 mysql 基本操作
- [Win32]服务器端程序
- selenium webdriver学习(十五)------------如何处理FirefoxProfile
- 技术博客
- Silverlight多重表头
- n个人围成一圈报数问题
- php 与 oracle11g 基本操作
- Java的序列化和反序列化
- mvc3[2]写代码规范
- mysql 安装问题回顾
- php与oracle11g经典分页
- auto_ptr浅析
- android拦截短信并删除该条短信
- Android编程心得-为TextView添加各种样式
- Oracle常用函数