テーブルとそのテーブルへのデータの挿入に問題があります。
2 つの異なるテーブルから 2 行の情報を隣同士に取得したいと考えています。しかし、テーブルごとに 2 つの行を分離する方法がわかりません。以下に私のコードを見つけることができます:
<form action="Stap5.php" method="POST">
<table border = '1'>
<tr>
<td>Vloerbetegeling</td>
<td>Wandbetegeling</td>
</tr>
<?php
$query="select * from vloertegel";
$result=mysql_query($query);
$query2="select * from wandtegel";
$result2=mysql_query($query2);
while($row=mysql_fetch_array($result))
{
?>
<tr>
<td><input type='radio' name='FloorTiles' value='<?php echo $row['Naam'] ?>' checked/><?php echo $row['Naam'] ?> <br/>
<img src='<?php echo $row['ImagePath'] ?>' width='200' height='200' /> </td>
</tr>
<?php
}
while($row2=mysql_fetch_array($result2))
{
?>
<tr>
<td><input type='radio' name='WallTiles' value='<?php echo $row2['Naam'] ?>'checked/> <?php echo $row2['Naam'] ?> <br/>
<img src='<?php echo $row2['ImagePath'] ?>' width='200' height='200'/></td>
</tr>
<?php
}
?>
</table>
<input type="submit" name="Stap5Submit" value="Volgende"/><br />
</form>
while ループにより、結果を取得するのが難しくなっています。