you need to define rows (const rows = client.query) before iterating
or maybe you can do what you're doing right now but use for r in result ?
But, errrm, what does this have to do with bitcoin? Don't think this is a general technical discussion board. Use Stackoverflow in the future.
The developer I work with have been stuck with this issue for few days now and I need help from someone experienced in js to answer this.
I seriously hope you're not paying him per hour
Thanks for the fix, I have just changed res to rows instead.
Does the forum have general tech discussion board? This question is related to a crypto method I am building in the exchange but of course had to change the names and params in the code before posting for security reasons, having that all said I still understand where you are coming from.
Regards to the developer I guess he might be busy with other projects etc, adding to that I want to say that he is not getting paid per hour but has instead % in the project.
I am looking for another dev as well to join, will you be interested in your spare time if possible? Even if it means as part time.
try
client.query(`SELECT * FROM colours_strength_table WHERE id == ${id}`,
function(err, rows) {
for (let r in rows) {
}
})
Thanks for the fix it works. Appreciated.
/////////////
The second issue I am facing is json result being returned as “success”
So have changed this line to:
if (strength === null && colour === null) { return res.json("no strength and colour params found in DB": false)}
I assume the code is not fetching correctly from DB the colour and strength as per this code:
if (r["id"] === id) {
strength = r["strength"]
colour = r["colour"]
How can this be fixed? I did check DB in terminal and have found the correct table with the correct params saved inside it etc, but why is node not able to get those params.