Using models
Models talk to the database and implement CRUD.
Factory: m('table_name')
php
$map['fid'] = 0;
$essay = m('essay')->where($map)->select();Generated SQL:
sql
SELECT * FROM `essay` WHERE `fid`=0;