| CODENOTIFIER | HelpYou are not signed inSign in |
Project: DBSlayer
Revision: 69
Author: dgottfrid
Date: 02 Jun 2008 22:41:02
Changes:merge krobertson patch for returning # of rows affected and insert id
Files:| ... | ...@@ -345,17 +345,23 @@ | |
| 345 | 345 | if(sql_result && all_result ) { |
| 346 | 346 | sql_result = json_object_create(mpool); |
| 347 | 347 | json_object_add(sql_result,"SUCCESS",json_boolean_create(mpool,1)); |
| 348 | json_object_add(sql_result,"AFFECTED_ROWS",json_long_create(mpool,(long)mysql_affected_rows(db))); | |
| 349 | json_object_add(sql_result,"INSERT_ID",json_long_create(mpool,(long)mysql_insert_id(db))); | |
| 348 | 350 | json_array_append(all_result,sql_result); |
| 349 | 351 | } else if (sql_result && !all_result) { |
| 350 | 352 | all_result = json_array_create(mpool,5); |
| 351 | 353 | json_array_append(all_result,sql_result); |
| 352 | 354 | sql_result = json_object_create(mpool); |
| 353 | 355 | json_object_add(sql_result,"SUCCESS",json_boolean_create(mpool,1)); |
| 356 | json_object_add(sql_result,"AFFECTED_ROWS",json_long_create(mpool,(long)mysql_affected_rows(db))); | |
| 357 | json_object_add(sql_result,"INSERT_ID",json_long_create(mpool,(long)mysql_insert_id(db))); | |
| 354 | 358 | json_array_append(all_result,sql_result); |
| 355 | 359 | json_object_add(out,"RESULT",all_result); |
| 356 | 360 | } else { |
| 357 | 361 | sql_result = json_object_create(mpool); |
| 358 | 362 | json_object_add(sql_result,"SUCCESS",json_boolean_create(mpool,1)); |
| 363 | json_object_add(sql_result,"AFFECTED_ROWS",json_long_create(mpool,(long)mysql_affected_rows(db))); | |
| 364 | json_object_add(sql_result,"INSERT_ID",json_long_create(mpool,(long)mysql_insert_id(db))); | |
| 359 | 365 | } |
| 360 | 366 | } |
| 361 | 367 | } else { |
| ... | ...@@ -5,3 +5,5 @@ | |
| 5 | 5 | - Tammy Hepps (chief open-source officer at the New York Times) |
| 6 | 6 | - Andrzej Lawn (statistics AJAX page) |
| 7 | 7 | |
| 8 | Ken Robertson - Support # of rows affected and insert id | |
| 9 |