V
V
Vladimir2019-10-05 12:58:34
MySQL
Vladimir, 2019-10-05 12:58:34

How to get the number of records in the database and output each value/value/value in turn?

Good afternoon. That's the problem. I need to loop records from the database. But I don't know the number of records or how can I display them all? Without brackets and all this dregs.
So it outputs 1 field without brackets from the first entry

connection.query("SELECT * FROM sms", function(err,res) {
        console.log(res.map((item) => item.phone.split("\r")[0])[0]);				
      });

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
netyshka, 2019-10-05
@isset89

Use foreach

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question