connecting to the database
const mysql = require('mysql');
// First you need to create a connection to the database
// Be sure to replace 'user' and 'password' with the correct values
const con = mysql.createConnection({
host: 'localhost',
user: 'user',
password: 'password',
});
con.connect((err) => {
if(err){
console.log('Error connecting to Db');
return;
}
console.log('Connection established');
});
con.end((err) => {
// The connection is terminated gracefully
// Ensures all remaining queries are executed
// Then sends a quit packet to the MySQL server.
});
Also in JavaScript:
- create component angular inline template
- match 10-12 digit javascript safaricom
- angular delete from array by name
- how to make a modal stay center of screen
- how to get the video time every second after
- take off element form end of array
- react open on different url instead of localhost
- read and save excel with react
- Error during serialization or deserialization using the JSON JavaScriptSerializer. The length of the string exceeds the value set on the maxJsonLength property.
- python http request post json example
- reverse every word
- if condition empty javascript
- javascript apexcharts to base 64 image
- loop dictionary with key and value javascript
- find duplicate values in array javascript
- get width of a dom element js
- three js get size of object
- http-proxy-middleware option.onProxyReq:
- hrtime to milliseconds
- vuepress firebase authentication
- jquery wait n seconds
- js vanilla detect any input
- Options to control prototype access
- javascript encode url to decode C#