本文整理匯總了PHP中Vendor::find_by_sql方法的典型用法代碼示例。如果您正苦於以下問題:PHP Vendor::find_by_sql方法的具體用法?PHP Vendor::find_by_sql怎麽用?PHP Vendor::find_by_sql使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Vendor
的用法示例。
在下文中一共展示了Vendor::find_by_sql方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getList
/**
* the getList method is used to
* pupolate the listing table
*/
public function getList($id = "", $pg)
{
$purl = array();
if (isset($_GET['url'])) {
$purl = $_GET['url'];
$purl = rtrim($purl);
$purl = explode('/', $_GET['url']);
} else {
$purl = null;
}
if (!isset($purl['2'])) {
$pn = 1;
} else {
$pn = $purl['2'];
}
global $database;
$resultEmployee = $database->db_query("SELECT * FROM vendors");
$pagin = new Pagination();
//create the pagination object;
$pagin->nr = $database->dbNumRows($resultEmployee);
$pagin->itemsPerPage = 20;
$myitems = Vendor::find_by_sql("SELECT * FROM vendors " . $pagin->pgLimit($pn));
$index_array = array("vendors" => $myitems, "mypagin" => $pagin->render($pg));
return $index_array;
return $index_array;
}
示例2: vendID_AutoComplete
/**
* this get an auto complete
* method on vendor for the purchase
* or orther form
*/
public function vendID_AutoComplete($id = "")
{
return Vendor::find_by_sql("SELECT * FROM vendors WHERE vend_id LIKE '%" . $_POST['input'] . "%'");
}