Guest User

mysql debug

a guest
Jan 22nd, 2015
257
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. LoadDroppedItems()
  2. {
  3. new query[1024];
  4. mysql_format(MySQL, query, sizeof(query), "SELECT * FROM `items` WHERE `owner` = '-1';");
  5. mysql_tquery(MySQL, query, "OnDroppedItemsLoad", "");
  6. return 1;
  7. }
  8.  
  9. public OnDroppedItemsLoad()
  10. {
  11. print("\n\n---------------------------");
  12. new rows = cache_num_rows();
  13. printf("num of rows = %d", rows);
  14.  
  15. for(new d; d < rows; d++)
  16. {
  17. static id, model, amount, Float:x, Float:y, Float:z;
  18. id = cache_get_field_content_int(d, "id", MySQL);
  19. model = cache_get_field_content_int(d, "model", MySQL);
  20. amount = cache_get_field_content_int(d, "amount", MySQL);
  21. x = cache_get_field_content_float(d, "coord_x", MySQL);
  22. y = cache_get_field_content_float(d, "coord_y", MySQL);
  23. z = cache_get_field_content_float(d, "coord_z", MySQL);
  24. CreateDroppedItem(id, model, amount, x, y, z);
  25.  
  26. #if defined DEBUGMSG
  27. new string[128];
  28. format(string, sizeof(string), "Loop %d retrieved item_id = %d and item_model = %d",d, id, model);
  29. print(string);
  30. #endif
  31. }
  32. print("---------------------------\n\n");
  33. return 1;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment