model->get

从数据库中获取单条记录

function get($object_id=0,$where='')

参数为主键ID的值,生成的SQL类似这样

select * from table where id = {$id} limit 1

如果希望使用另外的字段进行查询,需要传入$where参数,如 $model->get('me', 'name')。则生成的SQL为:

select * from table where name = 'me' limit 1

返回一个Record对象,在此对象上可以进行更多ORM操作。