php & html相互嵌套

php代码中插入html代码可以不用echo,而是很“粗暴”地打断——

<?php 
$i=0;
while($i<mysql_num_rows($result0))
{
  list($s_id,$d_id,$install_site,$type,$property,$measure_renge,$output_signal)=mysql_fetch_row($result0);
?>
//亮点在这里!
<tr> <td><?php echo $type;?></td> <td><?php echo $s_id;?></td> <td><?php echo $d_id;?></td> <td><?php echo $install_site;?></td> <td><input type="button" id="btn_t_<?php echo $i?>" class="l-button" value="查询" style="width:100px;" onclick="toshowtable('<?php echo $d_id?>')"></input></td> <td><input type="button" id="btn_c_<?php echo $i?>" class="l-button" value="查询" style="width:100px;" onclick="toshowchart('<?php echo $d_id?>')"></input></td> </tr> <?php $i++; } mysql_free_result($result0); ?>

 

posted @ 2012-11-04 23:00  Joyce-Lee  阅读(510)  评论(0编辑  收藏  举报