本文整理汇总了PHP中SQL::getAssoc方法的典型用法代码示例。如果您正苦于以下问题:PHP SQL::getAssoc方法的具体用法?PHP SQL::getAssoc怎么用?PHP SQL::getAssoc使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SQL
的用法示例。
在下文中一共展示了SQL::getAssoc方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getPrograms
function getPrograms($id = '')
{
if (!$id) {
$id = $this->zonedata['id'];
}
$fields = 'z.program_id AS id, p.program AS program';
$table = 'tblZones AS z, tblPrograms AS p';
$param = sprintf("z.parent_id = '%s' AND p.id = z.program_id", $id);
return SQL::getAssoc($table, $fields, $param);
}
示例2: getQuestionList
function getQuestionList($question_list = '')
{
// Used to preview questionaire in the addSurvey form
$ql = SQL::getAssoc('tblSurveyItems', 'id,question', sprintf("FIND_IN_SET(id,'%s')", $question_list));
$question_list = explode(',', $question_list);
$preView = "<TABLE cellpadding=0 cellspacing=0><TR><TD><OL>";
for ($i = 0; $i < count($question_list); $i++) {
$preView .= "<LI class=n02>" . $ql[$question_list[$i]];
}
$preView .= "</OL></TD></TR></TABLE>";
return $preView;
}
示例3: loadloans
function loadloans()
{
$this->data['loans'] = SQL::getAssoc('tblLoansMasterDetails AS lmd, tblLoans AS l', 'l.id, l.status', sprintf('lmd.master_id = %s AND l.id = lmd.loan_id', $this->data['id']));
foreach ($this->data['loans'] as $status) {
$this->data['cancelled'] = false;
if ($status != 'C') {
break;
} else {
$this->data['cancelled'] = true;
}
}
}
示例4: getAll
function getAll($status = '')
{
$status_operator = '=';
if (!$status) {
$status_operator = 'like';
$status = '%%';
}
$fields = 'id, program';
$table = 'tblPrograms';
$param = sprintf("status %s '%s'", $status_operator, $status);
return SQL::getAssoc($table, $fields, $param);
}
示例5: loadPayments
function loadPayments($id = '')
{
if (!$id) {
$id = $this->data['id'];
}
$fields = 'p.*,l.loan_code,concat(left(c.first,1),"."," ",left(c.last,14)) client';
$param = sprintf("rp.receipt_id = '%s' AND p.id = rp.payment_id AND l.id = p.loan_id AND c.id = l.client_id", $id);
$table = 'tblLinkReceiptsPayments AS rp, tblPayments AS p, tblLoans l, tblClients c';
$this->data['payments']['normal'] = SQL::getAssoc($table, $fields, $param);
$table = 'tblLinkReceiptsPayments AS rp, tblPaymentsRollback AS p, tblLoans l, tblClients c';
$this->data['payments']['rollback'] = SQL::getAssoc($table, $fields, $param);
}
示例6: currencys
function currencys()
{
return SQL::getAssoc('tblCurrencys', 'id,currency');
}
示例7: getBusiness
function getBusiness()
{
return SQL::getAssoc("tblBusiness AS b, tblClients as c", "b.id, b.name", sprintf("c.id = '%s' AND FIND_IN_SET(c.id,b.client_list)", $this->data['id']));
}
示例8: getName
function getName($userID)
{
return current(SQL::getAssoc('tblUsers', "id, CONCAT(first, ' ', last)", sprintf("id = '%s'", $userID)));
}