PHP 与MySQL:意外的 T_VARIABLE
在 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'];
} ?>
有什么想法吗?
Getting unexpected T_VARIABLE on 18 which is - 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'];
} ?>
Any Ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
丢失的 ';'在上一行中。
Missing ';' in the previous line.
是的,mysql_query 行中缺少分号。
Yeah, missing the semi colon on the line with the mysql_query.