摘要: 1.控制器代码 add方法function Add(){//添加数据 AR方式 // 自动添加 $info=M("info"); $attrn=$info->table("nation")->distinct(true)->select(); $this->assign("nation",$attrn); if(empty($_POST)){ $this->display(); }... 阅读全文
posted @ 2016-06-17 09:13 于超。 阅读(463) 评论(0) 推荐(0) 编辑
摘要: 1连贯操作的方法: 造一个info表的模型的对象 $info=M("info"); //使用的是M方法 $info->select(); // select方法 返回所有数据 $info->where("code='p001'")-> //添加条件; $info->table("nation")->select();//切换查询的表 info表的对象 但通过table方法 可以实现查nat... 阅读全文
posted @ 2016-06-17 09:05 于超。 阅读(498) 评论(0) 推荐(0) 编辑