javascript - adding to a value in a database not replacing it -


so storing users 'freinds' in database , using add there freind

socket.on('addfreind', function(username, freind) {     console.log("add freind " + freind + "to " + username)      let query = 'update users set freinds="' + freind + '" username = "' + username + '"';     connection.query(query, function(err) {         console.log(err)     }); }); 

but replaces original value new 1 how can add original value

i have tried querying original value , adding array , adding new value array putting in database failed horribly , wondering if there simple way


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -