Jump to content

Recommended Posts

Posted

I am using the following code:

var SQL = require('mysql')
var c = SQL.createConnection({
  host: '*here was my ip*',
  user: '*here was my user*',
  password: '*here was my password*',
  database: '*here was my database*'
});
console.log("TESTTESTTEST");
c.connect(function(e) {
console.log(123);
if(e) {
	console.log("Error connecting to the database with error "+e);
}
else {
	console.log('Database connected!')
}
});
c.query("INSERT INTO Cars VALUES (5,5,5,5,123)")
c.query("SELECT * FROM Cars", (err, result) => {
	console.log(result);
});

and it doesnt work when I run it as a part of server package, but works well when I run it with Node.

rx52aLw.png

Please, help me.

  • 6 months later...
Posted

I have a simelar issue (not with connection but with some transaction calls) ... did you found a solution (so that I maybe have a point where I have to look?)

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...