Search code examples
javascriptmysqlnode.jstwitch

MYSQL - Checking a var exists then updating if it does


Hi im coding a twitch bot. I want to have it check if someone is in the database if they are it adds 20 to their points.

For example it will have an array of viewers:

['kong','plays']

kongs points = 100
plays points = 123


Solution

  •  update table1
          set ponits=ponits+20
          where name=someOneName;
    

    i hope it works, it is just a update query