<?php
include("conn.php");
$sql="select * from homewelcome";
$querysql=mysql_query($sql);
while($row=mysql_fetch_array($querysql)){
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Whirlpool</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
dfdfds
<?php echo "$row[Id]" ?>
<?php } ?>
</body>
</html>
<?php ?>这块处理代码我无论放在哪里,($row[Id]这个值上面会出来空白)顶部都会出现一块空白,不是样式问题,当我把<?php?>去掉后,显示就正常!不知道为什么?希望哪位帮忙解决,谢谢了
include("conn.php");
$sql="select * from homewelcome";
$querysql=mysql_query($sql);
while($row=mysql_fetch_array($querysql)){
?>
就是这块,php程序处理
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Whirlpool</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
dfdfds
<?php
include("conn.php");
$sql="select * from homewelcome";
$querysql=mysql_query($sql);
while($row=mysql_fetch_array($querysql)){
?>
这里只放需要循环出现的内容
<?php echo "$row[Id]" ?>
<?php } ?>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Whirlpool</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
dfdfds
<?php
error_reporting(E_ALL);
include("conn.php");
$sql="select * from homewelcome";
$querysql=mysql_query($sql) or die(mysql_error());
while($row=mysql_fetch_array($querysql))
{
echo $row["Id"];
}
?>
</body>
</html>