上面这个类是最关键的。这个地方能明白,其它的都好说了。好,下面我们开始实例:
test.php
<?php include_once(''''./include.inc.php''''); $test = new Test(); $rs = $test->listTest(); foreach ( $rs as $array ) { $list[]=$array; $tpl->assign("list",$list); } $tpl->display("test.htm"); $info=array("name"=>"无喱头","addtime"=>date("Y-m-d")); $test->setTest(''''5'''',$info,''''update''''); ?>
接着我们写个HTM出来
test.htm
<{section name=sec loop=$list}> <{$list[sec].name}> <BR> <{/section}>
注:实际类名数据库名并不如上,只偶有改变。如果操作异常,请自行改正 运行一下看看。 怎么样,出来了吗效果。 上面的类文件实现了数据智能化操作,有什么问题,请与我讨论。 Q:20438713
上一页 [1] [2]
Copyright @ 2007-2012 敏韬网(敏而好学,文韬武略--MinTao.Net)(学习笔记) Inc All Rights Reserved. 闵涛 E_mail:admin@mintao.net(欢迎提供学习资源)
鄂公网安备 42011102001154号
站长:MinTao ICP备案号:鄂ICP备11006601号-18