PHP& MySQL:意外的T_VARIABLE

时间:2011-01-19 17:23:39

标签: php mysql fetch

在18上获得意外的T_VARIABLE - while($ row = mysql_fetch_assoc($ fetchCourses)){

<?php include("config.php"); ?>

<html>
<head>
    <!-- Style Sheets -->
    <link rel="stylesheet" href="stylesheets/reset.css" type="text/css" media=screen />
    <link rel="stylesheet" href="stylesheets/style.css" type="text/css" media=screen />
</head>
<body>

<?php 

$fetchCourses = mysql_query("SELECT * FROM CourseMembers
                            LEFT JOIN Courses ON Courses.CourseID = CourseMembers.CourseID
                            WHERE CourseMembers.UserID = 1
                            ORDER BY Courses.CourseName ASC")

while ($row = mysql_fetch_assoc($fetchCourses)) {
    echo $row['CourseName'];
} ?>

任何想法?

2 个答案:

答案 0 :(得分:7)

缺少';'在上一行。

答案 1 :(得分:5)

是的,错过了使用mysql_query的行上的半冒号。