0
テーブル内のリンクをクリックすると他のページに移動し、このカテゴリのすべての製品を選択します 私はDBから選択さTDは、私はあなたのリンクがあるべき他のページに移動し、このcategorieにDBからhtmlテーブルへのデータを選択し、他のページへのリンク(<a>)
テーブル内のリンクをクリックすると他のページに移動し、このカテゴリのすべての製品を選択します 私はDBから選択さTDは、私はあなたのリンクがあるべき他のページに移動し、このcategorieにDBからhtmlテーブルへのデータを選択し、他のページへのリンク(<a>)
をすべての製品を選択する]をクリックしたときにリンクするテーブルに
$sql = 'SELECT categorie.id,name,username FROM categorie,user
where user.id = categorie.added_by ';
$result = $mysqli->query($sql);
?>
<table class="data-table">
<h1>Categorie List<h1>
<thead>
<tr>
<th>Id</th>
<th>Username</th>
<th>Added By</th>
</tr>
</thead>
<tbody>
<?php
if($result == false)echo "errrrr";
else{
while ($row = mysqli_fetch_array($result))
{
echo '<tr>
<td>'.$row['id'].'</td>
// here i want link <a> when click go to other page and
// select all products in this categorie
<td>'.$row['name'].'</td>
<td>'.$row['username'].'</td>
</tr>';
}
}
?>
</tbody>
</table>
倍数になる可能性があるためにそれを行うにはこのようなもの:
...
<td><a href="otherpage.php?categorie='.$row['id'].'">'.$row['name'].'</a></td>
...
otherpage.phpで、カテゴリIDを$_GET['categorie']
から取得できます。