本文整理匯總了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>";
}