Hello,
Can you please tell me, how to get value of COUNT(*)?
Mysql query - > SELECT COUNT(*) from table
rows [0] = RowDataPacket {'COUNT(*)': 4}
rows[0].COUNT and other is not working.
Hi @enhaster, I know you closed this issue shortly after you opened it, so I hope you got your answer. For some additional information, you should be able to access it by using rows[0]['COUNT(*)'] according to the output you have above. In addition, if you use the SQL AS to name the column, it can make it easier to access in JavaScript. For example, if you use COUNT(*) AS count, then in this module, you can access using just rows[0].count.
Most helpful comment
Hi @enhaster, I know you closed this issue shortly after you opened it, so I hope you got your answer. For some additional information, you should be able to access it by using
rows[0]['COUNT(*)']according to the output you have above. In addition, if you use the SQLASto name the column, it can make it easier to access in JavaScript. For example, if you useCOUNT(*) AS count, then in this module, you can access using justrows[0].count.