mariano / node-db-mysql

MySQL database bindings for Node.js
http://nodejsdb.org
150 stars 30 forks source link

Update command having insert effects #96

Open amichaelgrant opened 11 years ago

amichaelgrant commented 11 years ago

An attempt to update a row in table is resulting in a new insert: Here is the code var id = 2; this.query() .update('User') .set({ 'othername': data.othername, 'surname': data.surname, 'status' : data.status }) .where('id = ?', [ id ]) .execute(function(error, result) { if (error) { console.log('ERROR: ' + error); return; } console.log('RESULT: ', result); });