Advertisement
Guest User

a_mysql

a guest
Aug 11th, 2012
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 2.98 KB | None | 0 0
  1. /**
  2.  * MySQL plugin R7
  3.  * Copyright (c) 2008-2011, BlueG
  4.  */
  5.  
  6. #if defined mysql_included
  7.     #endinput
  8. #endif
  9. #define mysql_included
  10.  
  11. /**
  12.  * Common error codes
  13.  *
  14.  * Client: http://dev.mysql.com/doc/refman/5.0/en/error-messages-client.html
  15.  * Server: http://dev.mysql.com/doc/refman/5.0/en/error-messages-server.html
  16.  *
  17.  */
  18.  
  19. #define ER_DBACCESS_DENIED_ERROR 1044
  20. #define ER_ACCESS_DENIED_ERROR 1045
  21. #define ER_UNKNOWN_TABLE 1109
  22. #define ER_SYNTAX_ERROR 1149
  23. #define CR_SERVER_GONE_ERROR 2006
  24. #define CR_SERVER_LOST 2013
  25. #define CR_COMMAND_OUT_OF_SYNC 2014
  26. #define CR_SERVER_LOST_EXTENDED 2055
  27.  
  28. // Native functions
  29.  
  30. #define mysql_fetch_row(%1) mysql_fetch_row_format(%1,"|")
  31. #define mysql_next_row() mysql_retrieve_row()
  32. #define mysql_get_field(%1,%2) mysql_fetch_field_row(%2,%1)
  33.  
  34. #define mysql_query_callback(%1, %2, %3, %4, %5) \
  35.     mysql_function_query(%5, %2, false, %3, "siii", %2, %1, %4, %5)
  36.  
  37. #define mysql_query(%1, %2, %3, %4) \
  38.     mysql_function_query(%4, %1, false, "OnQueryFinish", "siii", %1, %2, %3, %4)
  39.  
  40.  
  41. native mysql_affected_rows(connectionHandle = 1);
  42. native mysql_close(connectionHandle = 1);
  43. native mysql_connect(const host[], const user[], const database[], const password[], port = 3306);
  44. native mysql_data_seek(offset, connectionHandle = 1);
  45. native mysql_debug(enable = 1);
  46. native mysql_errno(connectionHandle = 1);
  47. native mysql_fetch_field(number, dest[], connectionHandle = 1);
  48. native mysql_fetch_field_row(string[], const fieldname[], connectionHandle = 1);
  49. native mysql_fetch_row_format(string[], const delimiter[] = "|", connectionHandle = 1);
  50. native mysql_format(connectionHandle, output[], format[], {Float,_}:...);
  51. native mysql_field_count(connectionHandle = 1);
  52. native mysql_free_result(connectionHandle = 1);
  53. native mysql_get_charset(destination[], connectionHandle = 1);
  54. native mysql_insert_id(connectionHandle = 1);
  55. native mysql_num_rows(connectionHandle = 1);
  56. native mysql_num_fields(connectionHandle = 1);
  57. native mysql_ping(connectionHandle = 1);
  58. native mysql_real_escape_string(const source[], destination[], connectionHandle = 1);
  59. native mysql_reconnect(connectionHandle = 1);
  60. native mysql_reload(connectionHandle = 1);
  61. native mysql_retrieve_row(connectionHandle = 1);
  62. native mysql_set_charset(charset[], connectionHandle = 1);
  63. native mysql_stat(const destination[], connectionHandle = 1);
  64. native mysql_store_result(connectionHandle = 1);
  65. native mysql_warning_count(connectionHandle = 1);
  66.  
  67. // Cache functions
  68.  
  69. native mysql_function_query(connectionHandle, query[], bool:cache, callback[], format[], {Float,_}:...);
  70. native cache_get_row(row, idx, dest[], connectionHandle = 1);
  71. native cache_get_field(field_index, dest[], connectionHandle = 1);
  72. native cache_get_data(&num_rows, &num_fields, connectionHandle = 1);
  73. native cache_get_field_content(row, const field_name[], dest[], connectionHandle = 1);
  74. native enable_mutex(bool:enable);
  75.  
  76. // forward declarations
  77.  
  78. forward OnQueryError(errorid, error[], callback[], query[], connectionHandle);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement