$results = mysqli_query($con,"SELECT * FROM dayalpha WHERE d_id= '".$_POST['dtb']."'");
echo "<table border='0'>
<tr>
<td>Day Name</td>
<td>Type</td>
<td>Alphabet</td>
</tr>";
while($row = mysqli_fetch_array($results))
{
echo "<tr>";
echo "<td>" . $row['dayname'] . "</td>";
echo "<td>" . $row['type'] . "</td>";
echo "<td>" . $row['alpha'] ."</td>";
echo "<td>" . $row['alpha1'] ."</td>";
echo "<td>" . $row['alpha2'] ."</td>";
echo "<td>" . $row['alpha3'] ."</td>";
echo "<td>" . $row['alpha4'] ."</td>";
echo "<td>" . $row['alpha5'] ."</td>";
echo "<td>" . $row['alpha6'] ."</td>";
echo "</tr>";
}
echo "</table>";
在这里,我显示了我的 dayalpha 表中的字母。每个字母表都应该链接到 babyname 表中的多个 bname,只要 alpha == iname (即 name initial 存储在 babyname 表中)。
-----------------
My Babyname Table
-----------------
iname bname gender mean
K Komal Female Tender
K Kiran Male Ray
K Kamlesh Male God
N Nityesh Male Yash
-----------------
My dayalpha table
-----------------
dayname type alpha alpha1 alpha2....
Monday vyainjan K G D
Wednesday vyainjan T D N
如何将 dayalpha 中的值链接到 babyname 的多个值?