@@ -806,7 +806,7 @@ can retrieve the insert id like this:
806
806
``` js
807
807
connection .query (' INSERT INTO posts SET ?' , {title: ' test' }, function (error , results , fields ) {
808
808
if (error) throw error;
809
- console .log (result .insertId );
809
+ console .log (results .insertId );
810
810
});
811
811
```
812
812
@@ -824,7 +824,7 @@ You can get the number of affected rows from an insert, update or delete stateme
824
824
``` js
825
825
connection .query (' DELETE FROM posts WHERE title = "wrong"' , function (error , results , fields ) {
826
826
if (error) throw error;
827
- console .log (' deleted ' + result .affectedRows + ' rows' );
827
+ console .log (' deleted ' + results .affectedRows + ' rows' );
828
828
})
829
829
```
830
830
@@ -838,7 +838,7 @@ whose values were not changed.
838
838
``` js
839
839
connection .query (' UPDATE posts SET ...' , function (error , results , fields ) {
840
840
if (error) throw error;
841
- console .log (' changed ' + result .changedRows + ' rows' );
841
+ console .log (' changed ' + results .changedRows + ' rows' );
842
842
})
843
843
```
844
844
@@ -1039,7 +1039,7 @@ connection.beginTransaction(function(err) {
1039
1039
});
1040
1040
}
1041
1041
1042
- var log = ' Post ' + result .insertId + ' added' ;
1042
+ var log = ' Post ' + results .insertId + ' added' ;
1043
1043
1044
1044
connection .query (' INSERT INTO log SET data=?' , log, function (error , results , fields ) {
1045
1045
if (error) {
0 commit comments