where()
方法进行比较查询。,``php,$data = Db::name('table_name')>where('column_name', '=', 'value')>select();,
`,这将生成一个SQL查询,用于从名为
table_name的表中选择所有满足
column_name等于
value`的记录。$model>relation('关联字段', '关联模型')>select();
where
方法链式调用即可实现。M
方法来查询数据条数。,,``php,$count = M('table_name')>count();,
``Powered By Z-BlogPHP 1.7.3
Copyright Your WebSite.Some Rights Reserved.