-1

嗨,我失去了理智,我无法弄清楚,请帮忙。

这是我的 sql:

$query = " select SQL_CALC_FOUND_ROWS * from programme where 1=1    ".$_SESSION['subject_where']." ".$_SESSION['practice_where']." ".$_SESSION['key_stage_where']." ".$_SESSION['targeted_group_where']." ".$_SESSION['search_where']." " ORDER BY Rating DESC " ";`

我的 MySQL 选择工作正常,但我想按评级对搜索结果进行排序。当我ORDER BY Rating DESC在变量之后插入时,我总是收到以下错误:

Error message: Parse error: syntax error, unexpected T_STRING in /home4/kenobi/public_html/programmes.php on line 23

请帮忙 - 我做错了什么?

4

1 回答 1

2
$query = " select SQL_CALC_FOUND_ROWS * from programme where 1=1 ".$_SESSION['subject_where']." ".$_SESSION['practice_where']." ".$_SESSION['key_stage_where']." ".$_SESSION['targeted_group_where']." ".$_SESSION['search_where']." ORDER BY Rating DESC ";

你有那些额外的报价在那里。除此之外... 1 = 1 是吧?这只是为了测试吗?

于 2013-10-01T02:51:06.263 回答