日期:2014-05-17  浏览次数:20480 次

PHP5不支持HTML混编吗?各自错误啊,求教~~~
PHP code
<?php
//引用文件
include("conn.php");
?>

<table width = "500" align = "center" bgcolor = #add3ef>
    <?php
    $sql = "SELECT * FORM message";
    $query = mysql_query($sql);
    whiel($row = mysql_fetch_array($query))
    {
    ?>
    <tr bgcolor = #eff3ff>
        <td>标题:<?php = $row[title]?> 用户:<?php = $row[user]?></td>
    </tr>
    
    <tr bgcolor = #ffffff>
        <td>内容:<?php = $row[content]?></td>
    </tr>
    <?php
    }
    ?>
</table>

无限提示我:Parse error: syntax error, unexpected '{' in D:\WampServer\www\bbs\list.php on line 11
这是为什么啊?视频里这么写的到我这里就不行了~~~
用的是:WampServer 2.2
救命呀,雅蠛蝶~~~~

------解决方案--------------------
whiel !=while

PHP code

<?php
//引用文件
include("conn.php");
?>

<table width = "500" align = "center" bgcolor = #add3ef>
    <?php
    $sql = "SELECT * FORM message";
    $query = mysql_query($sql);
    while($row = mysql_fetch_array($query))
    {
        ?>
        <tr bgcolor = #eff3ff>
            <td>标题:<?php echo $row['title']?> 用户:<?php echo $row['user']?></td>
        </tr>

        <tr bgcolor = #ffffff>
            <td>内容:<?php echo $row['content']?></td>
        </tr>
        <?php
    }
    ?>
</table>