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