我有2张桌子
Tbl A Cols: id nama kdwil
Tbl B Cols: id nama kdwil
要显示kdwil
是某些值
所以,我做了
$query2 = "SELECT * FROM a, b where a.kdwil=b.kdwil and a.kdwil='$kdwil'";
$result2 = mysql_query($query2);
while($row2 = mysql_fetch_array($result2)){
echo "<label><input type='checkbox' value='".$row2['nama']."'>".$row2['nama']."</label>";
但没有结果。
答案 0 :(得分:0)
$query2 = "SELECT * FROM a, b where a.kdwil=b.kdwil and a.kdwil='$kdwil'";
$result2 = mysql_query($query2);
while($row2 = mysql_fetch_assoc($result2)){
echo "<label><input type='checkbox' value='".$row2['nama']."'>".$row2['nama']."</label>";
改为使用mysql_fetch_assoc。