本文整理汇总了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'] . "%'");
}