21,886
社区成员
发帖
与我相关
我的任务
分享
<div align="left">
<h1 align="center"> </h1>
<h1 align="center"><strong>这里放个变量$data</strong></h1>
<p align="center"> </p>
</div>
<?php
...这里连接数据库
$data=xxx
?>
<?php
...这里连接数据库
$result = mysql_query($sql);
?>
<div align="left">
<h1 align="center"> </h1>
<?php
while($data = mysql_fetch_assoc($res)){
?>
<h1 align="center"><strong>这里放个变量<?php echo $data['xxx']?></strong></h1>
<?php
}
?>
<p align="center"> </p>
</div>
大概格式是这样的
<?php
...这里连接数据库
$data=xxx
?>
<div align="left">
<h1 align="center"> </h1>
<h1 align="center"><strong><?php var_dump($data)?></strong></h1>
<p align="center"> </p>
</div>
还是用个smarty什么的吧 程序和模版分开写好一点<div class="content"><?php echo $r['content'];?></div>