| | | | ------------ | ------------ | |DB::result_first()|查询并fetch单一结果(单数据表、单字段、单值)| |示例|DB::result_first("SELECT subject FROM ".DB::table("forum_thread")." WHERE `tid`=123");| |DB::fetch_first()|查询并fetch一个数组(单数据表、多字段、多值)| |示例|DB::fetch_first("SELECT * FROM ".DB::table('forum_thread')." WHERE `uid`=1");| |DB::fetch_all()|查询并fetch一个数组(多数据表、多字段、多值)| |示例|DB::fetch_all("SELECT * FROM " .DB::table('forum_thread')." t left join ".DB::table("forum_post")." p on p.tid=t.tid");| |DB::query()|普通查询| result_first 的结果: ```php 值 ``` fetch_first 的结果 ```php [ [threads] =>值, [posts] =>值, [follows] =>值 ] ``` fetch_all 的结果 ```php [ [0] => [thread]=>[ [字段 1] => 值, [字段 2] => 值 ], [1] => [thread]=>[ [字段 3] => 值, [字段 4] => 值 ], [2] => [thread]=>[ [字段 5] => 值, [字段 6] => 值 ], ] ```