code so far, sorry for bad formatting.con.connect(function(err) { if (err) throw err; con.query("SELECT * FROM tblusers", function (err, result, fields) { http.createServer(function (req, res) { res.write('' + result); //write a response to the client res.end(); //end the response }).listen(3000); console.log(result); //to see if it got results from DB }); }); Result in console shows data, result on HTML page shows [object Object].I know i'm missing something, and I've searched here AND on stackexchange for answers, closest thing I found was something to do withres.render but I'm not sure where that comes in, as the error message I get tells me it's not a function
Submitted December 18, 2018 at 05:13PM by orksaredorks
No comments:
Post a Comment