My query is:
connection.query("SELECT * FROM posts WHERE someId = 2", (err, rows) => {
allIds = [];
for(var i = 1; i <= rows.length; i++){
allIds.push(rows.id_post)
}
res.send("The IDs : " + allIds )
});
rows.length = 5
, I'm getting the response: The IDs : , , , , ,
. There is no data. I need all the IDs listed. Later want to run another query with those Ids, maybe in the same query but for now why aren't the IDs showing? What am I missing?