回答です

This commit is contained in:
a-kizaki
2026-10-28 16:53:31 +09:00
parent 06c1988850
commit fcaf9d4b5f
28 changed files with 10572 additions and 0 deletions

45
answer/Ex05.php Normal file
View 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>