本文整理汇总了PHP中SQLSelect::build_query方法的典型用法代码示例。如果您正苦于以下问题:PHP SQLSelect::build_query方法的具体用法?PHP SQLSelect::build_query怎么用?PHP SQLSelect::build_query使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SQLSelect
的用法示例。
在下文中一共展示了SQLSelect::build_query方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getDimensions
public function getDimensions()
{
if (empty($this->dimensions)) {
$dimension_number = 0;
foreach ($this->fields as $idfield => $fieldinfo) {
if (isset($fieldinfo['mapClass'])) {
$classname = $fieldinfo['mapClass'];
$mapsubobj = new $classname();
$sel = new SQLSelect($mapsubobj->table);
$sel->fetchas = "row";
$sel->selectfields["id"] = $mapsubobj->idfield;
if (!empty($mapsubobj->extra_selectfields) && isset($mapsubobj->extra_selectfields[$mapsubobj->titlefield])) {
$sel->selectfields["title"] = $mapsubobj->extra_selectfields[$mapsubobj->titlefield];
} else {
$sel->selectfields["title"] = $mapsubobj->titlefield;
}
$this->idfields[$dimension_number] = $idfield;
$sel->build_query();
$this->dimensions[$dimension_number] = $sel->execute();
$dimension_number++;
}
}
}
return $this->dimensions;
}
示例2: getRecord
public function getRecord($wherefields = array())
{
global $db;
$res = array();
if (empty($wherefields) && !empty($this->idfields)) {
$this->idfields = array_change_key_case($this->idfields);
foreach ($this->idfields as $key) {
if (isset($_REQUEST[$key])) {
$wherefields[$key] = $_REQUEST[$key];
}
}
}
if (!empty($wherefields)) {
$sql = new SQLSelect($this->table);
$sql->international = $this->international;
$sql->wherearray = $wherefields;
$sql->build_query();
$res = $db->get($sql->query, 'row');
}
if ($res != NULL && !empty($res) && isset($res[0])) {
return $res[0];
}
return array();
}