Advertisement
Guest User

Untitled

a guest
Mar 5th, 2017
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //mysql define part
  2.  
  3. var mysql = require('mysql');
  4. var connect = mysql.createConnection({
  5.       host: 'localhost'
  6.     , database: 'users'
  7.     , username: 'root'
  8.     , password: ''
  9.     });
  10.  
  11.  
  12. //in connection part
  13. io.sockets.on('connection', function(socket){
  14.     //con
  15.     connections.push(socket);
  16.     console.log('connected: %s socket connected', connections.length);
  17. //update row value part & and the error in this line to
  18.     connect.query("UPDATE users SET onoff= '1' WHERE UserName='sharkawey'");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement