AI智能回复搜索中,请稍后...
$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;//用于分页的给你一个我写过的多表查询案例,希望能帮到你: