Sir i got an error (Unhandled Rejection (TypeError): Cannot read property 'data' of undefined).
in this line (results:data.data).
I created my own API.
app.get('/Search',function(req,res){
con.query("select * from webtable where username like '%username%'",
function(err,searchrs){
console.log("Search results:",searchrs);
res.json(searchrs);
})
});
What corrections this API need ?
How to resolve that above error ?
Sir i got an error (Unhandled Rejection (TypeError): Cannot read property 'data' of undefined).
in this line (results:data.data).
I created my own API.
app.get('/Search',function(req,res){
con.query("select * from webtable where username like '%username%'",
function(err,searchrs){
console.log("Search results:",searchrs);
res.json(searchrs);
})
});
What corrections this API need ?
How to resolve that above error ?
Please answer me soon
Thanks in advance.
out need to check your output response because data is not declared the error says all
Cannot read property 'data' of undefined