Reputation: 23
I'm making an API and although all the syntax and the query fired is correct but it is showing me
code: 'ER_PARSE_ERROR',
errno: 1064,
sqlMessage: "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 'load' at line 1",
sqlState: '42000',
index: 0,
sql: 'select * from load'
My code
Router.get("/",(req,res)=>{
mysqlConnection.query("select * from load",(err,rows,fields)=>{
if(!err){
res.send(rows);
}else{
console.log(err);
}
})
});
'load' is the table name in my MySQL database and I want to fetch everything from there.
Upvotes: 1
Views: 6231