php - MySQLi Syntax Error when selecting from db -


this question has answer here:

i'm getting syntax error block of code, , have no idea why. here specific error itself: "you have error in sql syntax; check manual corresponds mysql server version right syntax use near 'match order id desc' @ line 1"

here php code block:

        $bbcode = new bbcode;          $sql = "select * match order id desc";          $res = mysqli_query($dbcon, $sql) or die(mysqli_error($dbcon));          $match = ""; 

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

to make code working change query to:

$sql = "select * `match` order id desc"; 

Comments

Popular posts from this blog

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

html - Outlook 2010 Anchor (url/address/link) -

android - How to create dynamically Fragment pager adapter -