You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi Everybody, has anyone by any chance an example of how to create table and record records?
i have been trying to do it, but the problem that i am having right now is that it stays in a loop and never releases the sql connection. but the records and tables are created in 4D, the problem is that to terminate the process, and the connection i have to kill the node process.
this is a snippet of my code in case that you can see a problem with it
app.get('/addtodb',(req,res) => {
connection.connect( function( error ) {
if( error ) {
console.log( "Cannot connect to database: " + error );
return;
} else {
let sql = "INSERT INTO node4d (ID, Name) VALUES (1, 'Yohan')";
let query = connection.query( sql, (error,result) =>{// this is the point
if( error ) {
console.log( "Failed to run query: " + error );
return;
} else {
console.log( "post table created");
res.send('post table created');
}
} );
}
} );
});
The text was updated successfully, but these errors were encountered:
Hi Everybody, has anyone by any chance an example of how to create table and record records?
i have been trying to do it, but the problem that i am having right now is that it stays in a loop and never releases the sql connection. but the records and tables are created in 4D, the problem is that to terminate the process, and the connection i have to kill the node process.
this is a snippet of my code in case that you can see a problem with it
app.get('/addtodb',(req,res) => {
connection.connect( function( error ) {
if( error ) {
console.log( "Cannot connect to database: " + error );
return;
} else {
let sql = "INSERT INTO node4d (ID, Name) VALUES (1, 'Yohan')";
let query = connection.query( sql, (error,result) =>{// this is the point
if( error ) {
console.log( "Failed to run query: " + error );
return;
} else {
console.log( "post table created");
res.send('post table created');
});
The text was updated successfully, but these errors were encountered: