本文整理汇总了PHP中SmartyPaginate::disconnect方法的典型用法代码示例。如果您正苦于以下问题:PHP SmartyPaginate::disconnect方法的具体用法?PHP SmartyPaginate::disconnect怎么用?PHP SmartyPaginate::disconnect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SmartyPaginate
的用法示例。
在下文中一共展示了SmartyPaginate::disconnect方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
$X = SmartyPaginate::getCurrentIndex();
$Y = SmartyPaginate::getLimit();
$searchSQL = "SELECT * FROM sionapros_news WHERE 1 ORDER BY news_no DESC LIMIT {$X},{$Y}";
$result = $dbcon->execute($searchSQL);
foreach ($result as $row) {
// collect each record into $_data
$data[] = $row;
}
// now we get the total number of records from the table
$rowsSQL = "SELECT COUNT(*) FROM sionapros_news WHERE 1";
$dbcon->query($rowsSQL);
#$rowNo = $rows[0];
SmartyPaginate::setTotal($dbcon->getValue());
$dbcon->free();
return $data;
}
$results = getSearchResults($db);
if (sizeof($results) == 0) {
$searchMsg = 'NO ARTICLES WERE FOUND';
$smarty->assign('searchMsg', $searchMsg);
} else {
// assign your db results to the template
$smarty->assign('news', $results);
// assign {$paginate} var
SmartyPaginate::assign($smarty);
}
$content = $smarty->fetch('./news/tm0.news.display_news.tpl.html');
SmartyPaginate::disconnect();
?>