Skip to content

Commit 137f34b

Browse files
daviditsygindougwilson
authored andcommitted
docs: fix incorrect variables in examples
closes #1640
1 parent 7c6b424 commit 137f34b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Readme.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -806,7 +806,7 @@ can retrieve the insert id like this:
806806
```js
807807
connection.query('INSERT INTO posts SET ?', {title: 'test'}, function (error, results, fields) {
808808
if (error) throw error;
809-
console.log(result.insertId);
809+
console.log(results.insertId);
810810
});
811811
```
812812

@@ -824,7 +824,7 @@ You can get the number of affected rows from an insert, update or delete stateme
824824
```js
825825
connection.query('DELETE FROM posts WHERE title = "wrong"', function (error, results, fields) {
826826
if (error) throw error;
827-
console.log('deleted ' + result.affectedRows + ' rows');
827+
console.log('deleted ' + results.affectedRows + ' rows');
828828
})
829829
```
830830

@@ -838,7 +838,7 @@ whose values were not changed.
838838
```js
839839
connection.query('UPDATE posts SET ...', function (error, results, fields) {
840840
if (error) throw error;
841-
console.log('changed ' + result.changedRows + ' rows');
841+
console.log('changed ' + results.changedRows + ' rows');
842842
})
843843
```
844844

@@ -1039,7 +1039,7 @@ connection.beginTransaction(function(err) {
10391039
});
10401040
}
10411041

1042-
var log = 'Post ' + result.insertId + ' added';
1042+
var log = 'Post ' + results.insertId + ' added';
10431043

10441044
connection.query('INSERT INTO log SET data=?', log, function (error, results, fields) {
10451045
if (error) {

0 commit comments

Comments
 (0)