本文整理匯總了PHP中phpbb\db\driver\driver_interface::get_estimated_row_count方法的典型用法代碼示例。如果您正苦於以下問題:PHP driver_interface::get_estimated_row_count方法的具體用法?PHP driver_interface::get_estimated_row_count怎麽用?PHP driver_interface::get_estimated_row_count使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類phpbb\db\driver\driver_interface
的用法示例。
在下文中一共展示了driver_interface::get_estimated_row_count方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: get_stats
/**
* Computes the stats and store them in the $this->stats associative array
*/
protected function get_stats()
{
if (strpos($this->db->get_sql_layer(), 'mysql') === false) {
$this->stats = array();
return;
}
$sql = 'SHOW INDEX
FROM ' . POSTS_TABLE;
$result = $this->db->sql_query($sql);
while ($row = $this->db->sql_fetchrow($result)) {
// deal with older MySQL versions which didn't use Index_type
$index_type = isset($row['Index_type']) ? $row['Index_type'] : $row['Comment'];
if ($index_type == 'FULLTEXT') {
if ($row['Key_name'] == 'post_subject') {
$this->stats['post_subject'] = $row;
} else {
if ($row['Key_name'] == 'post_content') {
$this->stats['post_content'] = $row;
}
}
}
}
$this->db->sql_freeresult($result);
$this->stats['total_posts'] = empty($this->stats) ? 0 : $this->db->get_estimated_row_count(POSTS_TABLE);
}
示例2: get_stats
protected function get_stats()
{
$this->stats['total_words'] = $this->db->get_estimated_row_count(SEARCH_WORDLIST_TABLE);
$this->stats['total_matches'] = $this->db->get_estimated_row_count(SEARCH_WORDMATCH_TABLE);
}