我有一个名为 forums 的表,其中包含4个字段:id_forum,标题,主题,fk_user。
我对以下一些内容进行了概述:
这是我的代码PHP概述
<?php
$bdd = new PDO('mysql:host=localhost;charset=utf8;dbname=exo', 'root', '');
$requestSQL = "SELECT forums.*, users.pseudo
FROM forums INNER JOIN users
ON forums.fk_user=users.id_user
ORDER BY theme ASC";
$stm = $bdd->prepare($requestSQL);
$stm->execute();
?>
<!doctype html>
<html lang="fr">
<head>
<meta charset="utf-8">
<title>Forum</title>
<link rel="stylesheet" href="style.css">
<script src="script.js"></script>
</head>
<body>
<div class="title"><a href="view_forum.php"><h1>List forum</h1></a></div>
</div>
<br /><br /><br /><br />
<table id="tab">
<tr>
<th>Id</th>
<th>Title</th>
<th>Theme</th>
<th>Pseudo</th>
</tr>
<?php
while($row = $stm->fetch()){ ?>
<tr>
<td><?php echo $row ['id_forum'];?></td>
<td><?php echo $row ['title'];?></td>
<td><?php echo $row ['theme'];?></td>
<td><?php echo $row['pseudo'];?></td>
</tr>
<?php
}
?>
</table>
</body>
</html>
如何在<a href>
行中添加<td><?php echo $row ['theme'];?></td>
?
我已经尝试过了
<?php
while($row = $stm->fetch()){ ?>
<tr>
<td><?php echo $row ['id_forum'];?></td>
<td><a href="view_user">?php echo $row ['title'];?></a></td>
<td><?php echo $row ['theme'];?></td>
<td><?php echo $row['pseudo'];?></td>
</tr>
<?php
}
?>
我的概述是灾难性的...