Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on May 11th, 2012  |  syntax: JavaScript  |  size: 0.56 KB  |  views: 91  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. var mysql = require('db-mysql');
  2. new mysql.Database({
  3.     hostname: 'localhost',
  4.     user: 'user',
  5.     password: 'password',
  6.     database: 'test'
  7. }).connect(function(error) {
  8.     if (error) {
  9.         return console.log('CONNECTION error: ' + error);
  10.     }
  11.     this.query("CALL p_stored_test(123)").
  12.         execute(function(error, rows, cols) {
  13.                 if (error) {
  14.                         console.log('ERROR: ' + error);
  15.                         return;
  16.                 }
  17.                 console.log(rows.length + ' ROWS found');
  18.         });
  19. });
clone this paste RAW Paste Data