感受生活、记录生活中的点点滴滴!

feed订阅 腾讯微博 新浪微博 qq 你好,欢迎光临! 

Tag Archives: Thinkphp

thinkphp查询方法

2012.11.30 , , , 2 Comments ,

普通查询除了字符串查询条件外,数组和对象方式的查询条件是非常常用的,这些是基本查询所必须掌握的。 一、使用数组作为查询条件 $User = M("User"); //实例化User对象 $condition['name'] = 'thinkphp'; // 把查询条件传入查询方法 $User->where($condition)->select(); 二、...

thinkphp关联查询

2012.11.30 , , , 3 Comments ,

两个表的关联查询: $M_shopping = M('Shops');  $M_product = M('Product');  $list_shops = $M_shopping->join('as shops left join hr_product as product on shops.product_id = product.p_id')  ->...

thinkphp实现无限极分类

2012.11.11 , , 14 Comments ,

首先看数据库表:xp_cate 控制器: CateAction.class.php <?php class CateAction extends Action{ function index(){ $cate=M('Cate'); $list=$cate->field("id,name,pid,path,concat(path,'-',id) as...