21,886
社区成员
发帖
与我相关
我的任务
分享
<?php
/*
* Created on 2010-4-24
*
* To change the template for this generated file go to
* Window - Preferences - PHPeclipse - PHP - Code Templates
*/
include("conn.php");
?>
<?php
echo "<table width=500 border='0' align='center' cellpadding='5' cellspacing='1' bgcolor='#add3ef'>";
$strSQL='select * from message ';
$query=mysql_query($strSQL);
while($rowMsg=mysql_fetch_array($query))
echo "<tr bgcolor='#eff3ff'>";
echo "<td>标题:$rowMsg[title] 用户:$rowMsg[userName]</td>";
echo "</tr><td>内容:$rowMsg[content]</td> </tr> </table>";
?>
<?php
echo "<table width=500 border='0' align='center' cellpadding='5' cellspacing='1' bgcolor='#add3ef'>";
$strSQL='select * from message ';
$query=mysql_query($strSQL);
while($rowMsg=mysql_fetch_array($query)) {
echo "<tr bgcolor='#eff3ff'>";
echo "<td>标题:$rowMsg[title] 用户:$rowMsg[userName]</td>";
echo "</tr><td>内容:$rowMsg[content]</td> </tr>";
}
echo '</table>'; //这个不包括在循环内
?>
$strSQL='select * from message ';
$query=mysql_query($strSQL);
while($rowMsg=mysql_fetch_array($query))
{
echo "<tr bgcolor='#eff3ff'>";
echo "<td>标题:$rowMsg[title] 用户:$rowMsg[userName]</td>";
echo "</tr><td>内容:$rowMsg[content]</td> </tr> </table>";
}
<?php
/*
* Created on 2010-4-22
*
* To change the template for this generated file go to
* Window - Preferences - PHPeclipse - PHP - Code Templates
*/
include("conn.php");
?>
<table width=500 border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#add3ef">
<?php
$sql="select * from message";
$query=mysql_query($sql);
while($row=mysql_fetch_array($query)){
?>
<tr bgcolor="#eff3ff">
<td>标题:<?=$row[title]?> 用户:<?=$row[user]."ttttt"?></td>
</tr>
<tr bgColor="#ffffff">
<td>内容:<?=$row[content]?></td>
</tr>
<?php
}
?>
</table>