首页 > 后端开发 > php教程 > 通过PHP实现DataGrid功能_PHP

通过PHP实现DataGrid功能_PHP

WBOY
发布: 2016-06-01 12:21:18
原创
1125 人浏览过

DataGrid

最近想做一个通过PHP实现DataGrid功能的东西,这样可以直接修改数据库中表的内容,而不用开发【新增数据页面】,【编辑页面】,于是乎在网上找了找,类似的东西也有几个,开源的、付费的都有,不过基本都是基于MySQL。由于需要连接Oracle所以从二次开发和页面样式来说个人觉得phpMyDataGrid还是比较好上手。本篇首先介绍基于MySQL的使用方法,再简单介绍对于Oracle连接(基于sqlrelay)的二次开发。

1. 创建测试数据库和表

以下为引用的内容:
<span style="COLOR: blue">create database </span>`guru`<span style="COLOR: gray">;</span>

<span style="COLOR: blue">USE </span>`guru`<span style="COLOR: gray">;</span>

<span style="COLOR: blue">CREATE TABLE </span>`employees` <span style="COLOR: gray">(
      </span>`id` <span style="COLOR: blue">int</span><span style="COLOR: gray">(</span>6<span style="COLOR: gray">) NOT NULL </span>auto_increment<span style="COLOR: gray">,
      </span>`name` <span style="COLOR: blue">char</span><span style="COLOR: gray">(</span>20<span style="COLOR: gray">) </span><span style="COLOR: blue">default </span><span style="COLOR: gray">NULL,
      </span>`lastname` <span style="COLOR: blue">char</span><span style="COLOR: gray">(</span>20<span style="COLOR: gray">) </span><span style="COLOR: blue">default </span><span style="COLOR: gray">NULL,
      </span>`salary` <span style="COLOR: blue">float default </span><span style="COLOR: gray">NULL,
      </span>`age` <span style="COLOR: blue">int</span><span style="COLOR: gray">(</span>2<span style="COLOR: gray">) </span><span style="COLOR: blue">default </span><span style="COLOR: gray">NULL,
      </span>`afiliation` <span style="COLOR: blue">date default </span><span style="COLOR: gray">NULL,
      </span>`status` <span style="COLOR: blue">int</span><span style="COLOR: gray">(</span>1<span style="COLOR: gray">) </span><span style="COLOR: blue">default </span><span style="COLOR: gray">NULL,
      </span>`active` <span style="COLOR: blue">tinyint</span><span style="COLOR: gray">(</span>1<span style="COLOR: gray">) </span><span style="COLOR: blue">default </span><span style="COLOR: gray">NULL,
      </span>`workeddays` <span style="COLOR: blue">int</span><span style="COLOR: gray">(</span>2<span style="COLOR: gray">) </span><span style="COLOR: blue">default </span><span style="COLOR: gray">NULL,
      </span>`photo` <span style="COLOR: blue">char</span><span style="COLOR: gray">(</span>30<span style="COLOR: gray">) </span><span style="COLOR: blue">default </span><span style="COLOR: gray">NULL,
      </span><span style="COLOR: blue">PRIMARY KEY  </span><span style="COLOR: gray">(</span>`id`<span style="COLOR: gray">)
)</span>

<span style="COLOR: blue">insert into </span>`employees`
    <span style="COLOR: gray">(</span>`id`<span style="COLOR: gray">,</span>`name`<span style="COLOR: gray">,</span>`lastname`<span style="COLOR: gray">,</span>`salary`<span style="COLOR: gray">,</span>`age`<span style="COLOR: gray">,</span>`afiliation`<span style="COLOR: gray">,</span>`status`<span style="COLOR: gray">,</span>`active`<span style="COLOR: gray">,</span>`workeddays`<span style="COLOR: gray">,</span>`photo`<span style="COLOR: gray">) 
    </span><span style="COLOR: blue">values </span><span style="COLOR: gray">(</span>1<span style="COLOR: gray">, </span><span style="COLOR: red">'Ana'</span><span style="COLOR: gray">, </span><span style="COLOR: red">'Trujillo'</span><span style="COLOR: gray">,</span>2000<span style="COLOR: gray">,</span>45<span style="COLOR: gray">, </span><span style="COLOR: red">'2005-05-13'</span><span style="COLOR: gray">,</span>1<span style="COLOR: gray">,</span>1<span style="COLOR: gray">,</span>10<span style="COLOR: gray">, </span><span style="COLOR: red">'1.jpg'</span><span style="COLOR: gray">);
</span><span style="COLOR: blue">insert into </span>`employees` 
    <span style="COLOR: gray">(</span>`id`<span style="COLOR: gray">,</span>`name`<span style="COLOR: gray">,</span>`lastname`<span style="COLOR: gray">,</span>`salary`<span style="COLOR: gray">,</span>`age`<span style="COLOR: gray">,</span>`afiliation`<span style="COLOR: gray">,</span>`status`<span style="COLOR: gray">,</span>`active`<span style="COLOR: gray">,</span>`workeddays`<span style="COLOR: gray">,</span>`photo`<span style="COLOR: gray">)
    </span><span style="COLOR: blue">values </span><span style="COLOR: gray">(</span>2<span style="COLOR: gray">, </span><span style="COLOR: red">'Jennifer'</span><span style="COLOR: gray">, </span><span style="COLOR: red">'Aniston'</span><span style="COLOR: gray">,</span>3500<span style="COLOR: gray">,</span>23<span style="COLOR: gray">, </span><span style="COLOR: red">'2004-10-22'</span><span style="COLOR: gray">,</span>1<span style="COLOR: gray">,</span>0<span style="COLOR: gray">,</span>0<span style="COLOR: gray">, </span><span style="COLOR: red">'2.jpg'</span><span style="COLOR: gray">);
</span><span style="COLOR: blue">insert into </span>`employees` 
    <span style="COLOR: gray">(</span>`id`<span style="COLOR: gray">,</span>`name`<span style="COLOR: gray">,</span>`lastname`<span style="COLOR: gray">,</span>`salary`<span style="COLOR: gray">,</span>`age`<span style="COLOR: gray">,</span>`afiliation`<span style="COLOR: gray">,</span>`status`<span style="COLOR: gray">,</span>`active`<span style="COLOR: gray">,</span>`workeddays`<span style="COLOR: gray">,</span>`photo`<span style="COLOR: gray">)
    </span><span style="COLOR: blue">values </span><span style="COLOR: gray">(</span>3<span style="COLOR: gray">, </span><span style="COLOR: red">'Michael'</span><span style="COLOR: gray">, </span><span style="COLOR: red">'Norman'</span><span style="COLOR: gray">,</span>1200<span style="COLOR: gray">,</span>19<span style="COLOR: gray">, </span><span style="COLOR: red">'2007-01-10'</span><span style="COLOR: gray">,</span>1<span style="COLOR: gray">,</span>1<span style="COLOR: gray">,</span>5<span style="COLOR: gray">, </span><span style="COLOR: red">'3.jpg'</span><span style="COLOR: gray">);
</span><span style="COLOR: blue">insert into </span>`employees` 
    <span style="COLOR: gray">(</span>`id`<span style="COLOR: gray">,</span>`name`<span style="COLOR: gray">,</span>`lastname`<span style="COLOR: gray">,</span>`salary`<span style="COLOR: gray">,</span>`age`<span style="COLOR: gray">,</span>`afiliation`<span style="COLOR: gray">,</span>`status`<span style="COLOR: gray">,</span>`active`<span style="COLOR: gray">,</span>`workeddays`<span style="COLOR: gray">,</span>`photo`<span style="COLOR: gray">)
    </span><span style="COLOR: blue">values </span><span style="COLOR: gray">(</span>4<span style="COLOR: gray">, </span><span style="COLOR: red">'Vanessa'</span><span style="COLOR: gray">, </span><span style="COLOR: red">'Black'</span><span style="COLOR: gray">,</span>6500<span style="COLOR: gray">,</span>31<span style="COLOR: gray">, </span><span style="COLOR: red">'2000-11-05'</span><span style="COLOR: gray">,</span>1<span style="COLOR: gray">,</span>1<span style="COLOR: gray">,</span>30<span style="COLOR: gray">, </span><span style="COLOR: red">'4.jpg'</span><span style="COLOR: gray">);
</span><span style="COLOR: blue">insert into </span>`employees` 
    <span style="COLOR: gray">(</span>`id`<span style="COLOR: gray">,</span>`name`<span style="COLOR: gray">,</span>`lastname`<span style="COLOR: gray">,</span>`salary`<span style="COLOR: gray">,</span>`age`<span style="COLOR: gray">,</span>`afiliation`<span style="COLOR: gray">,</span>`status`<span style="COLOR: gray">,</span>`active`<span style="COLOR: gray">,</span>`workeddays`<span style="COLOR: gray">,</span>`photo`<span style="COLOR: gray">)
    </span><span style="COLOR: blue">values </span><span style="COLOR: gray">(</span>5<span style="COLOR: gray">, </span><span style="COLOR: red">'Michael'</span><span style="COLOR: gray">, </span><span style="COLOR: red">'Strauss'</span><span style="COLOR: gray">,</span>3200<span style="COLOR: gray">,</span>45<span style="COLOR: gray">, </span><span style="COLOR: red">'2006-10-21'</span><span style="COLOR: gray">,</span>2<span style="COLOR: gray">,</span>0<span style="COLOR: gray">,</span>22<span style="COLOR: gray">, </span><span style="COLOR: red">'5.jpg'</span><span style="COLOR: gray">);
</span><span style="COLOR: blue">insert into </span>`employees` 
    <span style="COLOR: gray">(</span>`id`<span style="COLOR: gray">,</span>`name`<span style="COLOR: gray">,</span>`lastname`<span style="COLOR: gray">,</span>`salary`<span style="COLOR: gray">,</span>`age`<span style="COLOR: gray">,</span>`afiliation`<span style="COLOR: gray">,</span>`status`<span style="COLOR: gray">,</span>`active`<span style="COLOR: gray">,</span>`workeddays`<span style="COLOR: gray">,</span>`photo`<span style="COLOR: gray">)
    </span><span style="COLOR: blue">values </span><span style="COLOR: gray">(</span>6<span style="COLOR: gray">, </span><span style="COLOR: red">'William'</span><span style="COLOR: gray">, </span><span style="COLOR: red">'Brown'</span><span style="COLOR: gray">,</span>2300<span style="COLOR: gray">,</span>21<span style="COLOR: gray">, </span><span style="COLOR: red">'2001-03-10'</span><span style="COLOR: gray">,</span>3<span style="COLOR: gray">,</span>1<span style="COLOR: gray">,</span>10<span style="COLOR: gray">, </span><span style="COLOR: red">'6.jpg'</span><span style="COLOR: gray">);
</span><span style="COLOR: blue">insert into </span>`employees` 
    <span style="COLOR: gray">(</span>`id`<span style="COLOR: gray">,</span>`name`<span style="COLOR: gray">,</span>`lastname`<span style="COLOR: gray">,</span>`salary`<span style="COLOR: gray">,</span>`age`<span style="COLOR: gray">,</span>`afiliation`<span style="COLOR: gray">,</span>`status`<span style="COLOR: gray">,</span>`active`<span style="COLOR: gray">,</span>`workeddays`<span style="COLOR: gray">,</span>`photo`<span style="COLOR: gray">)
    </span><span style="COLOR: blue">values </span><span style="COLOR: gray">(</span>7<span style="COLOR: gray">, </span><span style="COLOR: red">'Lucca'</span><span style="COLOR: gray">, </span><span style="COLOR: red">'Normany'</span><span style="COLOR: gray">,</span>2800<span style="COLOR: gray">,</span>36<span style="COLOR: gray">, </span><span style="COLOR: red">'2006-10-02'</span><span style="COLOR: gray">,</span>3<span style="COLOR: gray">,</span>1<span style="COLOR: gray">,</span>20<span style="COLOR: gray">, </span><span style="COLOR: red">'7.jpg'</span><span style="COLOR: gray">);</span>
登录后复制

2. PHP程序介绍

phpMyDataGrid主要是通过phpmydatagrid.class.php,dgscripts.js来实现的,总共加起来不到100kB,又是一个小巧的软件。对于这两个文件就不多讲了,感兴趣的同学可以“打包带走”回去慢慢品。主要介绍该软件的使用方法,即实例datagrid_for_mysql.php。先看一下页面示意图:

2009-8-11-19.22.06

以下为引用的内容:
<span style="COLOR: blue"><?php 
include </span><span style="COLOR: purple">(</span><span style="COLOR: olive">"phpmydatagrid.class.php"</span><span style="COLOR: purple">)</span>;
<span style="COLOR: blue">$objGrid </span><span style="COLOR: purple">= </span><span style="COLOR: blue">new </span>datagrid;

<span style="COLOR: blue">$objGrid</span><span style="COLOR: purple">-></span>closeTags<span style="COLOR: purple">(</span><span style="COLOR: blue">true</span><span style="COLOR: purple">)</span>;  
<span style="COLOR: blue">$objGrid</span><span style="COLOR: purple">-></span>friendlyHTML<span style="COLOR: purple">()</span>;  
<span style="COLOR: blue">$objGrid</span><span style="COLOR: purple">-></span>methodForm<span style="COLOR: purple">(</span><span style="COLOR: olive">"get"</span><span style="COLOR: purple">)</span>; 
<span style="COLOR: green">//连接数据库
</span><span style="COLOR: blue">$objGrid</span><span style="COLOR: purple">-></span>conectadb<span style="COLOR: purple">(</span><span style="COLOR: olive">"127.0.0.1"</span><span style="COLOR: purple">, </span><span style="COLOR: olive">"root"</span><span style="COLOR: purple">, </span><span style="COLOR: olive">"root"</span><span style="COLOR: purple">, </span><span style="COLOR: olive">"guru"</span><span style="COLOR: purple">)</span>;<br /><span style="COLOR: green">//加密字符串
</span><span style="COLOR: blue">$objGrid</span><span style="COLOR: purple">-></span>salt<span style="COLOR: purple">(</span><span style="COLOR: olive">"Myc0defor5tr0ng3r-Pro3EctiOn"</span><span style="COLOR: purple">)</span>;
<span style="COLOR: blue">$objGrid</span><span style="COLOR: purple">-></span>language<span style="COLOR: purple">(</span><span style="COLOR: olive">"en"</span><span style="COLOR: purple">)</span>;
<span style="COLOR: green">//最后一列显示的功能键,从左向右功能为&ldquo;新增键&rdquo;、&ldquo;编辑键&rdquo;、&ldquo;删除键&rdquo;、&ldquo;浏览键&rdquo;。
</span><span style="COLOR: blue">$objGrid</span><span style="COLOR: purple">-></span>buttons<span style="COLOR: purple">(</span><span style="COLOR: blue">true</span><span style="COLOR: purple">,</span><span style="COLOR: blue">true</span><span style="COLOR: purple">,</span><span style="COLOR: blue">true</span><span style="COLOR: purple">,</span><span style="COLOR: blue">true</span><span style="COLOR: purple">)</span>;
<span style="COLOR: green">//修改数值时产生的Form名称
</span><span style="COLOR: blue">$objGrid</span><span style="COLOR: purple">-></span>form<span style="COLOR: purple">(</span><span style="COLOR: olive">'employee'</span><span style="COLOR: purple">, </span><span style="COLOR: blue">true</span><span style="COLOR: purple">)</span>;
<span style="COLOR: green">//可检索列名
</span><span style="COLOR: blue">$objGrid</span><span style="COLOR: purple">-></span>searchby<span style="COLOR: purple">(</span><span style="COLOR: olive">"name,lastname"</span><span style="COLOR: purple">)</span>;
<span style="COLOR: green">//需要读取的表
</span><span style="COLOR: blue">$objGrid</span><span style="COLOR: purple">-></span>tabla<span style="COLOR: purple">(</span><span style="COLOR: olive">"employees"</span><span style="COLOR: purple">)</span>;
<span style="COLOR: green">//索引值用于修改数据
</span><span style="COLOR: blue">$objGrid</span><span style="COLOR: purple">-></span>keyfield<span style="COLOR: purple">(</span><span style="COLOR: olive">"id"</span><span style="COLOR: purple">)</span>;
<span style="COLOR: green">//分页显示行数
</span><span style="COLOR: blue">$objGrid</span><span style="COLOR: purple">-></span>datarows<span style="COLOR: purple">(</span><span style="COLOR: red">20</span><span style="COLOR: purple">)</span>;
<span style="COLOR: green">//默认排序方式
</span><span style="COLOR: blue">$objGrid</span><span style="COLOR: purple">-></span>orderby<span style="COLOR: purple">(</span><span style="COLOR: olive">"name"</span><span style="COLOR: purple">, </span><span style="COLOR: olive">"ASC"</span><span style="COLOR: purple">)</span>;
<span style="COLOR: green">//显示列设置,相关设置可参考phpmydatagrid.class.php
</span><span style="COLOR: blue">$objGrid</span><span style="COLOR: purple">-></span>FormatColumn<span style="COLOR: purple">(</span><span style="COLOR: olive">"id"</span><span style="COLOR: purple">, </span><span style="COLOR: olive">"ID Employee"</span><span style="COLOR: purple">, </span><span style="COLOR: red">5</span><span style="COLOR: purple">, </span><span style="COLOR: red">5</span><span style="COLOR: purple">, </span><span style="COLOR: red">1</span><span style="COLOR: purple">, </span><span style="COLOR: olive">"50"</span><span style="COLOR: purple">, </span><span style="COLOR: olive">"center"</span><span style="COLOR: purple">, </span><span style="COLOR: olive">"integer"</span><span style="COLOR: purple">)</span>;
<span style="COLOR: blue">$objGrid</span><span style="COLOR: purple">-></span>FormatColumn<span style="COLOR: purple">(</span><span style="COLOR: olive">"name"</span><span style="COLOR: purple">, </span><span style="COLOR: olive">"Name"</span><span style="COLOR: purple">, </span><span style="COLOR: red">30</span><span style="COLOR: purple">, </span><span style="COLOR: red">30</span><span style="COLOR: purple">, </span><span style="COLOR: red">0</span><span style="COLOR: purple">, </span><span style="COLOR: olive">"150"</span><span style="COLOR: purple">, </span><span style="COLOR: olive">"left"</span><span style="COLOR: purple">)</span>;
<span style="COLOR: blue">$objGrid</span><span style="COLOR: purple">-></span>FormatColumn<span style="COLOR: purple">(</span><span style="COLOR: olive">"lastname"</span><span style="COLOR: purple">, </span><span style="COLOR: olive">"Last name"</span><span style="COLOR: purple">, </span><span style="COLOR: red">30</span><span style="COLOR: purple">, </span><span style="COLOR: red">30</span><span style="COLOR: purple">, </span><span style="COLOR: red">0</span><span style="COLOR: purple">, </span><span style="COLOR: olive">"150"</span><span style="COLOR: purple">, </span><span style="COLOR: olive">"left"</span><span style="COLOR: purple">)</span>;
<span style="COLOR: blue">$objGrid</span><span style="COLOR: purple">-></span>FormatColumn<span style="COLOR: purple">(</span><span style="COLOR: olive">"age"</span><span style="COLOR: purple">, </span><span style="COLOR: olive">"Age"</span><span style="COLOR: purple">, </span><span style="COLOR: red">5</span><span style="COLOR: purple">, </span><span style="COLOR: red">5</span><span style="COLOR: purple">, </span><span style="COLOR: red">0</span><span style="COLOR: purple">, </span><span style="COLOR: olive">"50"</span><span style="COLOR: purple">, </span><span style="COLOR: olive">"right"</span><span style="COLOR: purple">)</span>;<br /><span style="COLOR: green">//自定义日期格式
</span><span style="COLOR: blue">$objGrid</span><span style="COLOR: purple">-></span>FormatColumn<span style="COLOR: purple">(</span><span style="COLOR: olive">"afiliation"</span><span style="COLOR: purple">, </span><span style="COLOR: olive">"Afiliation Date"</span><span style="COLOR: purple">, </span><span style="COLOR: red">10</span><span style="COLOR: purple">, </span><span style="COLOR: red">10</span><span style="COLOR: purple">, </span><span style="COLOR: red">0</span><span style="COLOR: purple">, </span><span style="COLOR: olive">"100"</span><span style="COLOR: purple">, </span><span style="COLOR: olive">"center"</span><span style="COLOR: purple">, </span><span style="COLOR: olive">"date:dmy:/"</span><span style="COLOR: purple">)</span>;<br /><span style="COLOR: green">//编辑时可以自定义为<Select>模式</span>
<span style="COLOR: blue">$objGrid</span><span style="COLOR: purple">-></span>FormatColumn<span style="COLOR: purple">(</span><span style="COLOR: olive">"status"</span><span style="COLOR: purple">, </span><span style="COLOR: olive">"Status"</span><span style="COLOR: purple">, </span><span style="COLOR: red">5</span><span style="COLOR: purple">, </span><span style="COLOR: red">5</span><span style="COLOR: purple">, </span><span style="COLOR: red">0</span><span style="COLOR: purple">, </span><span style="COLOR: olive">"60"</span><span style="COLOR: purple">, </span><span style="COLOR: olive">"left"</span><span style="COLOR: purple">, </span><span style="COLOR: olive">"select:1_Single:2_Married:3_Divorced"</span><span style="COLOR: purple">)</span>;
<span style="COLOR: blue"><span style="COLOR: green">//编辑时可以自定义为<CheckBox>模式</span>
</span><span style="COLOR: blue">$objGrid</span><span style="COLOR: purple">-></span>FormatColumn<span style="COLOR: purple">(</span><span style="COLOR: olive">"active"</span><span style="COLOR: purple">, </span><span style="COLOR: olive">"Active"</span><span style="COLOR: purple">, </span><span style="COLOR: red">2</span><span style="COLOR: purple">, </span><span style="COLOR: red">2</span><span style="COLOR: purple">, </span><span style="COLOR: red">0</span><span style="COLOR: purple">,</span><span style="COLOR: olive">"50"</span><span style="COLOR: purple">, </span><span style="COLOR: olive">"center"</span><span style="COLOR: purple">, </span><span style="COLOR: olive">"check:No:Yes"</span><span style="COLOR: purple">)</span>;<br /><span style="COLOR: green">//自定义货币显示形式</span>
<span style="COLOR: blue">$objGrid</span><span style="COLOR: purple">-></span>FormatColumn<span style="COLOR: purple">(</span><span style="COLOR: olive">"salary"</span><span style="COLOR: purple">, </span><span style="COLOR: olive">"Salary"</span><span style="COLOR: purple">, </span><span style="COLOR: red">10</span><span style="COLOR: purple">, </span><span style="COLOR: red">10</span><span style="COLOR: purple">, </span><span style="COLOR: red">0</span><span style="COLOR: purple">, </span><span style="COLOR: olive">"90"</span><span style="COLOR: purple">, </span><span style="COLOR: olive">"right"</span><span style="COLOR: purple">, </span><span style="COLOR: olive">"money:&euro;"</span><span style="COLOR: purple">)</span>;<br /><span style="COLOR: green">//将数据以柱状图显示</span>
<span style="COLOR: blue">$objGrid</span><span style="COLOR: purple">-></span>FormatColumn<span style="COLOR: purple">(</span><span style="COLOR: olive">"workeddays"</span><span style="COLOR: purple">, </span><span style="COLOR: olive">"Work days"</span><span style="COLOR: purple">, </span><span style="COLOR: red">5</span><span style="COLOR: purple">, </span><span style="COLOR: red">2</span><span style="COLOR: purple">, </span><span style="COLOR: red">0</span><span style="COLOR: purple">, </span><span style="COLOR: olive">"50"</span><span style="COLOR: purple">, </span><span style="COLOR: olive">"right"</span><span style="COLOR: purple">, </span><span style="COLOR: olive">"chart:percent:val:31"</span><span style="COLOR: purple">)</span>;
<span style="COLOR: blue">$objGrid</span><span style="COLOR: purple">-></span>checkable<span style="COLOR: purple">()</span>;
<span style="COLOR: blue">$objGrid</span><span style="COLOR: purple">-></span>setHeader<span style="COLOR: purple">()</span>;
<span style="COLOR: blue">$objGrid</span><span style="COLOR: purple">-></span>ajax<span style="COLOR: purple">(</span><span style="COLOR: olive">'silent'</span><span style="COLOR: purple">)</span>;
<span style="COLOR: blue">echo </span><span style="COLOR: olive">'<html>
      <head><title>PHPDataGrid</title></head>
      <body><div align="center"><br />'</span>;
<span style="COLOR: green">//生成DataGrid
</span><span style="COLOR: blue">$objGrid</span><span style="COLOR: purple">-></span>grid<span style="COLOR: purple">()</span>;
<span style="COLOR: blue">echo </span><span style="COLOR: olive">'</div></body></html>'</span>;<br /><span style="COLOR: green">//关闭数据库连接</span>
<span style="COLOR: blue">$objGrid</span><span style="COLOR: purple">-></span>desconectar<span style="COLOR: purple">()</span>;
<span style="COLOR: blue">?></span>
登录后复制

3. 基于Oracle简介

对于Oracle的读取主要是把phpmydatagrid.class.php中与MySQL连接的函数修改为Oracle,本篇是通过sqlrelay(可参考http://sqlrelay.sourceforge.net/)进行的Oracle连接,当然也可以使用PHP自带的OCI8模块(效率有些低),修改后另存为phporadatagrid.class.php即可在其他程序(datagrid_for_oracle.php)中调用。以上涉及的所有程序均可在压缩包中找到。

希望对大家有用!

http://cid-c75f4e27adfe5bbc.skydrive.live.com/embedrowdetail.aspx/GnieTech/phpMyDataGrid.zip

作者: Gnie

出处: {GnieTech} (http://www.cnblogs.com/gnielee/)

来源:php.cn
本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板