I try to create a
html element for each element in an array but It doesn't work can you help me ?
my node js code :
con.connect(function(err) {
// if (err) throw err;
console.log("Connected!")
con.query( 'SELECT * FROM `commentairesapplicationscommunautaire` ', function (error, results, fields) {
for (var i = 0; i < results.length; i++){
var zeuzryueartt = results[i].contenu
console.log(zeuzryueartt)
res.end('<p> '+ zeuzryueartt +' </p>')
}
});
});
this code looks like : <p> rrr </p>
But is wrong for my case
Thanks
rescoming from? Iscon.connectinside of a node handler? Regardless, you can only useres.end/send/jsononce per callback. You'll have to concatenate these into a single variable and send that back