Advertisement
Guest User

Untitled

a guest
Feb 9th, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. module.exports = {
  2. getJoueurById: function () {
  3.  
  4. var connection = mysql.createConnection({
  5. host : 'localhost',
  6. user : 'root',
  7. password : ''
  8. });
  9.  
  10. connection.query('USE testnode');
  11. connection.query('SELECT * FROM joueur', function (err, rows) {
  12. if(err) {
  13. throw err;
  14. }else{
  15. console.log( rows );
  16. return rows;
  17. }
  18. });
  19.  
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement