0
$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表的字母。每個字母表應與嬰兒名錶中的多個姓名相關聯(即姓名初始 存儲在嬰兒名錶中)。如何在SQL中加入2個表格
-----------------
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的多個值?
你的問題是什麼? – Hogan
你是從頭開始設計這張桌子嗎?任何時候你開始輸入var1,var2,var3,var4,你都應該認識到一個模式,並且你可能會做錯了。如果一個dalalpha可以有任何數量的alpha值,它們應該放在一個單獨的表格中。 – Jess
根據我的代碼我得到這樣的輸出:星期一KGD – Komal