This PHP file summarises what I have learnt about using PHP to manipulate SQL Databases in W3Schools. Most of the code is commented out so if you want to test it out you will have to uncomment it.
var mysql = require('mysql'); // The following account must exists in MySQL! var con = mysql.createConnection({ host: "localhost", user: "nodejsUser", password ...