Wednesday 24 May 2017

What is the most modern, and secure way to use mysql with nodeJS(without php)?

I'm trying to make a webpage, using only javascript. I want to build a secure and reliable mysql connection with nodeJS, but I don't really know where to start. I also noticed, NodeJS doesn't have an improved mysql(mysqli) like php, so it seems really deprecated to me. "Only javascript" is a proper development method? Can I fully substitute php with nodeJS? Will I be able to prevent SQL Injections? Does it even make sense to leave php behind? Where, and when people use only javascript principle.

I found this code but it is really anemic: Can you suggest me an intermediate course or tutorial?

 var mysql = require('mysql');

   var con = mysql.createConnection({
   host: "localhost",
   user: "myusername",
   password: "mypassword"
   });

   con.connect(function(err) {
   if (err) throw err;
   console.log("Connected!");
   });



via JustMatthew

No comments:

Post a Comment