Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

javascript sql

const mysql = require('mysql');

const sqlServer = mysql.createConnection({
  host: 'localhost',
  user: 'yourusername',
  password: 'yourpassword',
});

sqlServer.connect((error) => {
  console.log('Connected To Database!');
  sqlServer.query('SELECT * FROM applicaton.customers', (queryError, result) => {
    console.log(result);
  });
});
Comment

PREVIOUS NEXT
Code Example
Javascript :: useeffect with cleanup 
Javascript :: Prevent Double Submit with JavaScript 
Javascript :: array of objects to array 
Javascript :: express-ejs-layouts install 
Javascript :: get array index by key value js 
Javascript :: last element in javascript 
Javascript :: javascript set html select value 
Javascript :: addclass to elementref angular 
Javascript :: get date javascript 
Javascript :: replace class js 
Javascript :: vscode react auto import 
Javascript :: react native text ellipsis 
Javascript :: javascript window size 
Javascript :: Fibonacci Series Program. in javascript 
Javascript :: Package path ./compat is not exported from 
Javascript :: decode morse code js 
Javascript :: angular {{}} new line 
Javascript :: you should not use switch outside a router react 
Javascript :: delete all the rows of table javascript 
Javascript :: file picker electron 
Javascript :: Loop array backwards in JS 
Javascript :: windows how to set process.env variables 
Javascript :: which methods do not have the hook equivalents in reactjs 16.8++ 
Javascript :: string to jsonobject gson 
Javascript :: find one with specofoc id mongoose 
Javascript :: cypress get element val and return it 
Javascript :: react useref 
Javascript :: javascript math.random 
Javascript :: next js back to previous page 
Javascript :: iframe reload parent page 
ADD CONTENT
Topic
Content
Source link
Name
1+1 =