本文整理汇总了PHP中DataBase::ExecuteAndReturnResult方法的典型用法代码示例。如果您正苦于以下问题:PHP DataBase::ExecuteAndReturnResult方法的具体用法?PHP DataBase::ExecuteAndReturnResult怎么用?PHP DataBase::ExecuteAndReturnResult使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataBase
的用法示例。
在下文中一共展示了DataBase::ExecuteAndReturnResult方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: GetNavigationControlsHTML
public static function GetNavigationControlsHTML($sql, $tam_pag = 30){
$res = DataBase::ExecuteAndReturnResult($sql);
$nrows = mysql_num_rows($res);
$npaginas = ceil($nrows / $tam_pag);
$html = "<div align='center'>";
for ($i = 1; $i <= $npaginas; $i++)
$html .= "<a href='" . $PHP_SELF . "?pag=$i'>$i</a> -";
$html = substr($html,0,strlen($html)-1); #stripping the last dash
return $html .= "</div>";
}
示例2: GetNavigationControlsHTML
public static function GetNavigationControlsHTML($sql, $tam_pag, $orderby){
$ajax=1;
$res = DataBase::ExecuteAndReturnResult($sql);
$nrows = mysql_num_rows($res);
$npaginas = ceil($nrows / $tam_pag);
$html = "<div align='center'>";
for ($i = 1; $i <= $npaginas; $i++)
{
if ($ajax==1)
$html .= "<a href='javascript:;' onClick='get(\"" . $_SERVER['PHP_SELF'] . "?pag=$i&order=$orderby\",\"content\")' >$i</a> -";
else
$html .= "<a href='" . $_SERVER['PHP_SELF'] . "?pag=$i&order=$orderby'>$i</a> -";
}
$html = substr($html,0,strlen($html)-1); #stripping the last dash
return $html .= "</div>";
}