phpmysql不适用于select语句

时间:2017-10-07 15:28:29

标签: php

我写了一个SQL语句。它适用于SQL工作区,但如果嵌入在PHP中,则无法工作:

$xcourse = mysql_query("select result.student, result.course,
                             course.course_code, result.score,course.unit 
                        from result 
                            left join course on result.course = course.id 
                            right join user on result.student = user.username 
                        where result.level = $xlevel 
                        and result.semester = $xsemester 
                        and result.class = '$dept' 
                        and result.year = '$xsession' 
                        and user.specialization = '2' 
                        order by result.student asc");

如果在SQL工作区中插入值,它将起作用。我想知道出了什么问题。

0 个答案:

没有答案