本文整理汇总了PHP中Guest::selectAll方法的典型用法代码示例。如果您正苦于以下问题:PHP Guest::selectAll方法的具体用法?PHP Guest::selectAll怎么用?PHP Guest::selectAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Guest
的用法示例。
在下文中一共展示了Guest::selectAll方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Guest
<div class="modal-body">
<div class="form-group">
<label for="name">Access Code
<input class="form-control" type="text" id="code" name="code" value="<?php
echo $originalOption->Code;
?>
"/>
</label>
</div>
<div class="form-group">
<label>Staff</label>
<select class="form-control" name="guestid" id="guestid">
<?php
$access = new Guest($db);
$stmt = $access->selectAll();
while ($row_access = $stmt->fetch(PDO::FETCH_ASSOC)) {
extract($row_access);
if ($originalOption->Guest_Id == $Id) {
echo "<option value='{$Id}' selected='selected'>{$FirstName} {$LastName}</option>";
} else {
echo "<option value='{$Id}'>{$FirstName} {$LastName}</option>";
}
}
?>
</select>
</div>
</div>
<div class="modal-footer">
<input type="submit" class="btn btn-primary" name="update" value="Update" />
示例2: Guest
</head>
<body>
<form method="post" action="addguestaccess.php" id="editform" role="form">
<div class="modal-body">
<div class="form-group">
<label for="name">Access Code
<input class="form-control" type="text" id="code" name="code"/>
</label>
</div>
<div class="form-group">
<label>Guest</label>
<select class="form-control" name="guestid" id="guestid">
<?php
$guest = new Guest($db);
$stmt = $guest->selectAll();
while ($row_guest = $stmt->fetch(PDO::FETCH_ASSOC)) {
extract($row_guest);
echo "<option value='{$Id}'>{$FirstName} {$LastName}</option>";
}
?>
</select>
</div>
</div>
<div class="modal-footer">
<input type="submit" class="btn btn-primary" name="add" value="Add" />
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</form>
</body>