本文整理汇总了PHP中PHPWS_DB::getAssoc方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPWS_DB::getAssoc方法的具体用法?PHP PHPWS_DB::getAssoc怎么用?PHP PHPWS_DB::getAssoc使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHPWS_DB
的用法示例。
在下文中一共展示了PHPWS_DB::getAssoc方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: execute
public function execute()
{
$this->checkinCounts = PHPWS_DB::getAssoc("select hall_name, count(*) from hms_checkin JOIN hms_hall_structure ON hms_checkin.bed_id = hms_hall_structure.bedid WHERE term = {$this->term} and checkout_date IS NULL GROUP BY hall_name ORDER BY hall_name");
if (PHPWS_Error::isError($this->checkinCounts)) {
throw new DatabaseException($this->checkinCounts->toString());
}
}
示例2: execute
public function execute()
{
PHPWS_Core::initModClass('hms', 'HMS_Residence_Hall.php');
foreach ($this->getHalls() as $hall) {
$hallCount = PHPWS_DB::getAssoc("select reason, count(*) from hms_assignment JOIN hms_bed ON hms_assignment.bed_id = hms_bed.id JOIN hms_room ON hms_bed.room_id = hms_room.id JOIN hms_floor ON hms_room.floor_id = hms_floor.id JOIN hms_residence_hall ON hms_floor.residence_hall_id = hms_residence_hall.id where hms_residence_hall.id = {$hall->getId()} AND hms_assignment.term = {$this->getTerm()} group by reason order by reason");
if (PHPWS_Error::isError($hallCount)) {
throw new DatabaseException($hallCount->toString());
}
$this->hallCounts[$hall->getId()] = $hallCount;
$floors = $hall->get_floors();
foreach ($floors as $floor) {
$floorCount = PHPWS_DB::getAssoc("select reason, count(*) from hms_assignment JOIN hms_bed ON hms_assignment.bed_id = hms_bed.id JOIN hms_room ON hms_bed.room_id = hms_room.id JOIN hms_floor ON hms_room.floor_id = hms_floor.id where hms_floor.id = {$floor->getId()} AND hms_assignment.term = {$this->getTerm()} group by reason order by reason");
if (PHPWS_Error::isError($floorCount)) {
throw new DatabaseException($floorCount->toString());
}
$this->floorCounts[$floor->getId()] = $floorCount;
}
}
}