這裏我試圖從MySQL表中獲取數據並將其填充到html中。一切工作正常但我想通過IF條件呼應HTML按鈕。我不知道這是否可以工作..如果它工作...任何人都可以請告訴我如何使它工作?錯誤時得到的是...內部服務器錯誤:(HTML和PHP嵌入
注:我已經commeted在那裏我有問題
<?php
if(mysql_num_rows($sql)){
while($rs = mysql_fetch_object($sql))
{
?>
<tr>
<td align="center"><?php echo $rs->cnf_name ;?></td>
<td align="center"><?php echo $rs->address;?></td>
<td align="center"><?php echo $rs->added_on;?></td>
<td align="center"><input type="button" class="btn" value="Edit" onClick="window.parent.editCnf('<?php echo $rs->cnf_name;?>','<?php echo $rs->username ;?>','<?php echo $rs->password;?>','<?php $rs->type;?>','<?php echo $rs->person_name;?>','<?php echo $rs->address;?>','<?php echo $rs->mobile_no?>','<?php echo $rs->email;?>','<?php echo $rs->country;?>','<?php echo $rs->city;?>','<?php echo $rs->state;?>','<?php echo $rs->area;?>')" ></td>
//PROBLEM
<td align="center">
<?php
if($rs->cnf_status == 0)
{
echo "<input type="button" class="btn" id="status" value="Activate" onClick="window.parent.deleteCnf(<?php echo $rs->user_id;?>,<?php echo $rs->cnf_status; ?>);">";
}
else
{
echo "<input type="button" class="btn" id="status" value="Activate" onClick="window.parent.deleteCnf(<?php echo $rs->user_id;?>,<?php echo $rs->cnf_status; ?>);">";
}
?>
</td>
</tr>
<?php
}
}
else
{
?> <tr>
<td colspan="">No data to display</td>
</tr>
<?php
}
?>
</tbody>
</table>