回答です
This commit is contained in:
45
answer/Ex05.php
Normal file
45
answer/Ex05.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
// Ex05.php
|
||||
|
||||
require_once __DIR__ . '/Ex05_query.php';
|
||||
|
||||
$joinData = getJoinData();
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>JOIN Query Result</title>
|
||||
<link href="../common/css/bootstrap.min.css" rel="stylesheet">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="container">
|
||||
<h1>JOINによるSELECTクエリの実行 結果</h1>
|
||||
<?php if (!empty($joinData)): ?>
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>従業員名</th>
|
||||
<th>部署名</th>
|
||||
<th>プロジェクト名</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($joinData as $row): ?>
|
||||
<tr>
|
||||
<td><?php echo htmlspecialchars($row['employee_name']); ?></td>
|
||||
<td><?php echo htmlspecialchars($row['department_name']); ?></td>
|
||||
<td><?php echo htmlspecialchars($row['project_name']); ?></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php else: ?>
|
||||
<p>データがありません。</p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
Reference in New Issue
Block a user