我有以下代码用于根据状态对表信息进行排序。
$query = "SELECT * FROM affiliate_tasks WHERE username = '$_SESSION[username]'";
if( isset($_POST['sort-selection'] && $_POST['sort-selection'] != 'all' ) )
{
$query .= " AND status = '". $_POST['sort-selection']."';" ;
}
$result = mysqli_query($con, $query);
当我运行网页时,它给了我这个错误:
Parse error: syntax error, unexpected T_BOOLEAN_AND, expecting ',' or ')' in /home/content/38/10473938/html/website/panda/affiliates/task.php on line 60
第60行如下:
if( isset($_POST['sort-selection'] && $_POST['sort-selection'] != 'all' ) ) {
我无法弄清楚代码有什么问题,任何帮助将不胜感激!