本文整理汇总了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);
}