该问题已被锁定!
4
关注
2533
浏览

二次开发时遇到的一个技术问题

AI智能回复搜索中,请稍后...

为什么被折叠? 0 个回复被折叠
Alu 初级会员 用户来自于: 广东省广州市
2014-07-15 10:56
$this->query_all('SELECT us.[i], ua.[/i] FROM ' . $this->get_table('users') . ' AS us LEFT JOIN ' . $this->get_table('users_attrib') . ' AS ua ON us.uid = ua.uid WHERE ' . implode(' AND ', $where) . ' GROUP BY us.uid ORDER BY us.' . $order_by, calc_page_limit($page, $per_page));
//这段是查出数据

$_found_rows = $this->query_row('SELECT COUNT(DISTINCT us.uid) AS count FROM ' . $this->get_table('users') . ' AS us LEFT JOIN ' . $this->get_table('users_attrib') . ' AS ua ON us.uid = ua.uid WHERE ' . implode(' AND ', $where));
$found_rows = $_found_rows['count'];
$found_rows;//用于分页的
给你一个我写过的多表查询案例,希望能帮到你: