Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update & Delete Query missing '.' between 'where()' and 'execute()' #90

Open
alexandercharlie opened this issue Dec 30, 2012 · 0 comments

Comments

@alexandercharlie
Copy link

Update Query Corrected Here:

var mysql = require('db-mysql');
new mysql.Database({
hostname: 'localhost',
user: 'user',
password: 'password',
database: 'test'
}).connect(function(error) {
if (error) {
return console.log('CONNECTION error: ' + error);
}
this.query().
update('users').
set({ 'name': 'New Name' }).
where('id = ?', [ 1 ]).
execute(function(error, result) {
if (error) {
console.log('ERROR: ' + error);
return;
}
console.log('RESULT: ', result);
});
});

Delete Query Corrected Here:

var mysql=require('db-mysql');
new mysql.Database({
hostname:'localhost',
user:'root',
password:'ok',
database:'test'
}).connect(function(error){
if(error){
return console.log('CONNECTION error: '+error);
}
this.query().
delete().
from('NODEDB').
where('id=?',[1]).
execute(function(error,result){
if(error){
console.log('ERROR: '+error);
return;
}
console.log('RESULT: ',result);
});

});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant