thinkphp条件查询

1.这是我在做项目的时候编写的:

$profit = M('shipping_types',' ','DB_PROFIT');//没有表前缀,在M函数的第二个参数就为空。

//条件
$field = array();
$field += array('id' => 'id');
$field += array('shipping_type' => 'business_line');
$profit->field($field);
$business_line_lists = $profit->select();//查询
echo $profit->getLastSql();输出sql语句
posted @ 2014-11-17 14:58  KOBE-Jason  阅读(123)  评论(0编辑  收藏  举报