javascript - i want a random array value to be thrown into my database, how? -
this question has answer here:
var sql = "insert info (name, age, lastname) values ?"; var values = [ ['johny', '28', 'high'], ['peeter', '39', 'lowsta'], ['amie', '25', 'pear'], ['hanah', '27', 'main'] ]; con.query(sql, [values], function (err, result) { console.log("number of records inserted: " + result.affectedrows); }); })``; i have code dont want give every value in array 1 random 1 how do that? (right give values in array , want give 1 of them must random)
Comments
Post a Comment