I am trying to make a register page and for database I use Nodejs with Mysql and to use require(); I use browserify but system gives an error like 'Net.CreateConnection is not a function'.How can I solve this ?
I am trying to make a register page and for database I use Nodejs with Mysql and to use require(); I use browserify but system gives an error like 'Net.CreateConnection is not a function'.How can I solve this ?
var mysql=require("mysql");
var con=mysql.createConnection({
host:"localhost",
user:"root",
password:"",
database:"cihantokerdatabase"
});
con.connect(function(err){
if(err) throw err;
console.log("connected!");
});
function register(){
con.connect(function(err){
if(err) throw err;
console.log("connected!");
});
}
This is the code without browserify.I couldn't add the code with browserify because it is nearly 40k lines of code.