从db [duplicate]中选择时出现MySQLi语法错误

This question already has an answer here:

I'm getting a syntax error with this block of code, and I have no idea why. Here is the specific error itself: "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'match ORDER BY id DESC' at line 1"

Here is the PHP code block:

        $bbcode = new BBCode;

        $sql = "SELECT * FROM match ORDER BY id DESC";

        $res = mysqli_query($dbCon, $sql) or die(mysqli_error($dbCon));

        $match = "";
</div>

MATCH is a reserved keyword in mysql: https://dev.mysql.com/doc/refman/5.0/en/keywords.html

To make your code working change your query to:

$sql = "SELECT * FROM `match` ORDER BY id DESC";