PHP编程

通过PHP实现DataGrid功能

日期:2009/08/17 11:36:44来源: 绿色资源网整理

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

创建测试数据库和表

create database `guru`;USE `guru`;CREATE TABLE `employees` (      `id` int(6) NOT NULL auto_increment,      `name` char(20) default NULL,      `lastname` char(20) default NULL,      `salary` float default NULL,      `age` int(2) default NULL,      `afiliation` date default NULL,      `status` int(1) default NULL,      `active` tinyint(1) default NULL,      `workeddays` int(2) default NULL,      `photo` char(30) default NULL,      PRIMARY KEY  (`id`)
)insert into `employees`(`id`,`name`,`lastname`,`salary`,`age`,`afiliation`,`status`,`active`,`workeddays`,`photo`) values (1, 'Ana', 'Trujillo',2000,45, '2005-05-13',1,1,10, '1.jpg');insert into `employees` (`id`,`name`,`lastname`,`salary`,`age`,`afiliation`,`status`,`active`,`workeddays`,`photo`)values (2, 'Jennifer', 'Aniston',3500,23, '2004-10-22',1,0,0, '2.jpg');insert into `employees` (`id`,`name`,`lastname`,`salary`,`age`,`afiliation`,`status`,`active`,`workeddays`,`photo`)values (3, 'Michael', 'Norman',1200,19, '2007-01-10',1,1,5, '3.jpg');insert into `employees` (`id`,`name`,`lastname`,`salary`,`age`,`afiliation`,`status`,`active`,`workeddays`,`photo`)values (4, 'Vanessa', 'Black',6500,31, '2000-11-05',1,1,30, '4.jpg');insert into `employees` (`id`,`name`,`lastname`,`salary`,`age`,`afiliation`,`status`,`active`,`workeddays`,`photo`<span

相关文章

相关下载

网友评论

我要评论...
没有更早的评论了
取消