本文整理匯總了PHP中DataProvider::executeQuery方法的典型用法代碼示例。如果您正苦於以下問題:PHP DataProvider::executeQuery方法的具體用法?PHP DataProvider::executeQuery怎麽用?PHP DataProvider::executeQuery使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類DataProvider
的用法示例。
在下文中一共展示了DataProvider::executeQuery方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: printf
</div>
<?php
$i++;
$dem++;
}
if ($dem == 0) {
printf('<div id="phantrang" style="color:#00F; font-size:30px; font-weight:bold">Không tìm thấy sản phẩm bạn đang tìm.</div>');
}
?>
<?php
// dem so mau tin co trong CSDL
//$sql = "SELECT COUNT(*) AS numrows FROM product";
//$sql = sprintf('select count(*) as numrows from product where thuong');
$sql = "select count(*) as numrows from product where codep like '%" . $th . "%'";
$result = DataProvider::executeQuery($sql);
$row = mysql_fetch_array($result, MYSQL_ASSOC);
$numrows = $row['numrows'];
// tinh tong so trang se hien thi
$maxPage = ceil($numrows / $rowsPerPage);
// hien thi lien ket den tung trang
$self = "timkiemsp_admin.php";
$nav = '';
for ($page = 1; $page <= $maxPage; $page++) {
if ($page == $pageNum) {
$nav .= sprintf(' %s ', $page);
// khong can tao link cho trang hien hanh
} else {
//$nav .= " <a href=\"$self?page=$page\">$page</a> ";
$nav .= sprintf('<a href="%s?page=%s&txttimkiem=%s"> %s </a> ', $self, $page, $_REQUEST['txttimkiem'], $page);
}
示例2: sprintf
<?php
}
}
?>
</div>
<?php
$i++;
}
?>
<?php
// dem so mau tin co trong CSDL
//$sql = "SELECT COUNT(*) AS numrows FROM product";
$sql1 = sprintf('select count(*) as numrows from product where nguoidang = "Hảo"');
$result1 = DataProvider::executeQuery($sql1);
$row = mysql_fetch_array($result1, MYSQL_ASSOC);
$numrows1 = $row['numrows'];
// tinh tong so trang se hien thi
$maxPage1 = ceil($numrows1 / $rowsPerPage1);
// hien thi lien ket den tung trang
$self1 = "admin.php";
$nav1 = '';
for ($page1 = 1; $page1 <= $maxPage1; $page1++) {
if ($page1 == $pageNum1) {
$nav1 .= sprintf(' %s ', $page1);
// khong can tao link cho trang hien hanh
} else {
//$nav .= " <a href=\"$self?page=$page\">$page</a> ";
$nav1 .= sprintf('<a href="%s?page=%s"> %s </a> ', $self1, $page1, $page1);
}