在编写程序中,写添加和更新sql语句是一个比较烦琐的过程,特别是在表结构比较复杂的时候
这个程序主要是根据数据表格式自动生成添加/更新的sql语句,然后由程序员直接加入到程序中,方便编程
下面是文件,方法建立一个单独的文件,按照下面的说明建立相关文件,运行即可
index.php 索引文件
config.php 配置文件,转换get/post数据
addxxx.php 根据提交表格数据生成sql语句
addxxx2.php 根据数据库表信息生成sql语句,配置数据库在文件内部
@author bluemaple<bluemaple@xinhuanet.com>
----------------------------------------------------------
index.php文件
----------------------------------------------------------
自动生成模版
<br><br>
<a href=../../addxxx.php>自动生成添加表格,并产生相关sql添加语句,生成update语句(简单版)</a>
<br><br>
<a href=../../addxxx2.php>更数据表生成相关添加页面</a>
----------------------------------------------------------
config.php文件
----------------------------------------------------------
<?
/* 转换get和post数据 */
if (!defined('pma_grab_globals_included'))
{
define('pma_grab_globals_included', 1);
if (!empty($_get))
{
extract($_get);
}
else if (!empty($http_get_vars))
{
extract($http_get_vars);
} // end if
if (!empty($_post))
{
extract($_post);
}
else if (!empty($http_post_vars))
{
extract($http_post_vars);
} // end if
if (!empty($_files))
{
while (list($name, $value) = each($_files))
{
$$name = $value['tmp_name'];
}
}
else if (!empty($http_post_files
| 对此文章发表了评论 |
