[Plugin] [REL] MySQL Plugin (Now on github!)

What ever happened to Pain123 developing this plugin?
Reply

Quote:
Originally Posted by RealCop228
Посмотреть сообщение
What ever happened to Pain123 developing this plugin?
maddinat0r is a Pain123 xd
Reply

Quote:
Originally Posted by RealCop228
Посмотреть сообщение
What ever happened to Pain123 developing this plugin?
Quote:
Originally Posted by B-Matt
Посмотреть сообщение
maddinat0r is a Pain123 xd
Exactly, I am (or I was) a Pain123. I changed my name because I wanted to make it consistent so that users would recognize me easier through other services/websites.
Reply

Ah. Okay then. haha
Reply

NO ! You aren't Pain123 ! You killed him and now you say that you are him ! >:O

Yes, we can recognize "maddinat0r" easier.

Can you list the changes from R35 here ? Or ... how much time left (how much do you think) until you release it officially ?
Reply

An alternative of the old mysql_ping()
Reply

mysql_errno
Reply

Quote:
Originally Posted by IstuntmanI
Посмотреть сообщение
[...]
Can you list the changes from R35 here ? Or ... how much time left (how much do you think) until you release it officially ?
Hey, why not release it just now!

--------------------------------
R35 is released.
Changes:
Код:
- code cleanup
- performance improvements
- improved and added some log messages
- callback and format parameters at "mysql_tquery" and "mysql_pquery" are optional now
- all cache natives which use the active cache (all "cache_*" natives but "cache_delete", "cache_set_active" and "cache_is_valid") are ignoring the 'connectionHandle' parameter
- added native "orm_delvar" to delete already added variables from an ORM instance
- added new log type 'LOG_ALL' which logs everything
- added native "cache_is_valid" to check whether the specified cache is valid
- added native "mysql_pquery" to send parallel queries
- added native "mysql_option" to toggle global MySQL options
- added native "mysql_current_handle" to retrieve the currently used handle in a result callback
- added optional parameter 'pool_size' to native "mysql_connect"
- added connection pool (to be used with new 'pool_size' parameter in "mysql_connect" and new native "mysql_pquery")
- fixed a bug where mysql_escape_string didn't set the destination var to empty if the source variable was empty
- fixed a bug where the HTML logging logged every callback even if there wasn't any log message in it
- fixed a bug where the plugin entered an infinite loop while calling "mysql_close" with the 'wait' parameter activated
A big thanks to everyone who tested it and gave suggestions. And a special thanks to JernejL who gave many useful suggestions and critics.

Download is as always available here.
Reply

Awesome, i'll update my later on today!
Reply

Really nice update. Is it possible that the infinite loop bug had something to do with this?:
https://sampforum.blast.hk/showthread.php?tid=485569
As I'm using wait = true in mysql_close
Reply

Quote:
Originally Posted by Mellnik
Посмотреть сообщение
Really nice update. Is it possible that the infinite loop bug had something to do with this?:
https://sampforum.blast.hk/showthread.php?tid=485569
As I'm using wait = true in mysql_close
I don't think so. Your whole server is crashing, but that bug is only putting the server into a state of infinite sleep.
Reply

Great release, thanks maddinat0r ! I love how it works on my shitty computer. :3
Reply

Nice release, I hope this update really does reduce more crashes..
Reply

Server crash on GMX though r35 windows XP sp3

pawn Код:
[28/01/2014 19:43:35] [debug] Server crashed while executing Kcnr.amx
[28/01/2014 19:43:36] [debug] AMX backtrace:
[28/01/2014 19:43:36] [debug] #0 native mysql_close () [1002eb00] from mysql.dll
[28/01/2014 19:43:36] [debug] #1 00025c70 in public OnGameModeExit () from Kcnr.amx
[28/01/2014 19:43:38] [debug] Native backtrace:
[28/01/2014 19:43:38] [debug] #0 7c910829 in ?? () from C:\WINDOWS\system32\ntdll.dll
[28/01/2014 19:43:38] [debug] #1 00bad9ee in ?? () from LIBMYSQL.dll
[28/01/2014 19:43:38] [debug] #2 00b5757e in ?? () from LIBMYSQL.dll
[28/01/2014 19:43:38] [debug] #3 1002ebf2 in ?? () from plugins\mysql.dll
[28/01/2014 19:43:38] [debug] #4 004010b6 in ?? () from samp-server.exe
[28/01/2014 19:43:38] [debug] #5 013b58ca in ?? () from plugins\crashdetect.dll
[28/01/2014 19:43:38] [debug] #6 013b774f in ?? () from plugins\crashdetect.dll
[28/01/2014 19:43:38] [debug] #7 013b0834 in ?? () from plugins\crashdetect.dll
[28/01/2014 19:43:38] [debug] #8 013b591a in ?? () from plugins\crashdetect.dll
[28/01/2014 19:43:38] [debug] #9 0046ca1c in ?? () from samp-server.exe









--------------------------

SA-MP Server: 0.3z-RC4



Exception At Address: 0xFF006AEC Module: (Unknown)



Registers:

EAX: 0x00000000 EBX: 0x00000000 ECX: 0x7FFDF000 EDX: 0x00EE0608

ESI: 0x0310E130 EDI: 0x00EE0000 EBP: 0x8B55FF8B ESP: 0x7C80244E

EFLAGS: 0x00010246



Stack:

+0000: 0x4BE80875   0x5DFFFFFF   0x900004C2   0x90909090

+0010: 0xFFFF9090   0x0000FFFF   0x24360000   0x90907C80

+0020: 0x90909090   0x90909090   0x90909090   0x90909090

+0030: 0xFF8B9090   0x8BEC8B55   0xF8830C45   0xFB840FFF

+0040: 0xB900006E   0x00002710   0x4D8BE1F7   0xF7018908

+0050: 0x045189D8   0xF700D283   0x890189DA   0xC18B0451

+0060: 0x0008C25D   0x90909090   0x55FF8B90   0x006AEC8B

+0070: 0xFF0875FF   0x8014BC15   0x0FC0857C   0x01089A8C

+0080: 0x40C03300   0x0004C25D   0x839AB068   0x00A1647C

+0090: 0x50000000   0x1024448B   0x10246C89   0x10246C8D

+00A0: 0x5653E02B   0xF8458B57   0x50E86589   0xC7FC458B

+00B0: 0xFFFFFC45   0x4589FFFF   0xF0458DF8   0x0000A364

+00C0: 0x8BC30000   0x8964F04D   0x0000000D   0x5E5F5900

+00D0: 0xC351C95B   0x90909090   0x90909090   0x90909090

+00E0: 0xFF8B9090   0x6AEC8B55   0x0C75FF00   0xE80875FF

+00F0: 0x0000000E   0x0008C25D   0x90909090   0x90909090

+0100: 0x346A9090   0x80260868   0xFF7AE87C   0x45C7FFFF

+0110: 0x000014BC   0xC045C700   0x00000001   0x7D8DC033

+0120: 0xABABABC4   0x8D57FF33   0xFF50BC45   0x80124815

+0130: 0xFC7D897C   0x0018A164   0x45890000   0x30408BDC



--------------------------



Loaded Modules:

samp-server.exe A: 0x00400000 - 0x004F5000  (C:\Documents and Settings\Karim\My Documents\Grand Theft Auto San Andreas\SA-MP SERVER(CNR)\samp-server.exe)

ntdll.dll   A: 0x7C900000 - 0x7C9B2000  (C:\WINDOWS\system32\ntdll.dll)

kernel32.dll    A: 0x7C800000 - 0x7C8F6000  (C:\WINDOWS\system32\kernel32.dll)

SHELL32.dll A: 0x7C9C0000 - 0x7D1D7000  (C:\WINDOWS\system32\SHELL32.dll)

ADVAPI32.dll    A: 0x77DD0000 - 0x77E6B000  (C:\WINDOWS\system32\ADVAPI32.dll)

RPCRT4.dll  A: 0x77E70000 - 0x77F03000  (C:\WINDOWS\system32\RPCRT4.dll)

Secur32.dll A: 0x77FE0000 - 0x77FF1000  (C:\WINDOWS\system32\Secur32.dll)

GDI32.dll   A: 0x77F10000 - 0x77F59000  (C:\WINDOWS\system32\GDI32.dll)

USER32.dll  A: 0x7E410000 - 0x7E4A1000  (C:\WINDOWS\system32\USER32.dll)

msvcrt.dll  A: 0x77C10000 - 0x77C68000  (C:\WINDOWS\system32\msvcrt.dll)

SHLWAPI.dll A: 0x77F60000 - 0x77FD6000  (C:\WINDOWS\system32\SHLWAPI.dll)

WSOCK32.dll A: 0x71AD0000 - 0x71AD9000  (C:\WINDOWS\system32\WSOCK32.dll)

WS2_32.dll  A: 0x71AB0000 - 0x71AC7000  (C:\WINDOWS\system32\WS2_32.dll)

WS2HELP.dll A: 0x71AA0000 - 0x71AA8000  (C:\WINDOWS\system32\WS2HELP.dll)

WINMM.dll   A: 0x76B40000 - 0x76B6D000  (C:\WINDOWS\system32\WINMM.dll)

IMM32.DLL   A: 0x76390000 - 0x763AD000  (C:\WINDOWS\system32\IMM32.DLL)

comctl32.dll    A: 0x773D0000 - 0x774D3000  (C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.6028_x-ww_61e65202\comctl32.dll)

comctl32.dll    A: 0x5D090000 - 0x5D12A000  (C:\WINDOWS\system32\comctl32.dll)

mysql.dll   A: 0x10000000 - 0x10061000  (C:\Documents and Settings\Karim\My Documents\Grand Theft Auto San Andreas\SA-MP SERVER(CNR)\plugins\mysql.dll)

LIBMYSQL.dll    A: 0x00B20000 - 0x00D5E000  (C:\Documents and Settings\Karim\My Documents\Grand Theft Auto San Andreas\SA-MP SERVER(CNR)\LIBMYSQL.dll)

MSVCP110.dll    A: 0x00D70000 - 0x00DF5000  (C:\WINDOWS\system32\MSVCP110.dll)

MSVCR110.dll    A: 0x00E00000 - 0x00ED6000  (C:\WINDOWS\system32\MSVCR110.dll)

mswsock.dll A: 0x71A50000 - 0x71A8F000  (C:\WINDOWS\system32\mswsock.dll)

DNSAPI.dll  A: 0x76F20000 - 0x76F47000  (C:\WINDOWS\system32\DNSAPI.dll)

iphlpapi.dll    A: 0x76D60000 - 0x76D79000  (C:\WINDOWS\system32\iphlpapi.dll)

winrnr.dll  A: 0x76FB0000 - 0x76FB8000  (C:\WINDOWS\System32\winrnr.dll)

WLDAP32.dll A: 0x76F60000 - 0x76F8C000  (C:\WINDOWS\system32\WLDAP32.dll)

rasadhlp.dll    A: 0x76FC0000 - 0x76FC6000  (C:\WINDOWS\system32\rasadhlp.dll)

streamer.dll    A: 0x01110000 - 0x0114E000  (C:\Documents and Settings\Karim\My Documents\Grand Theft Auto San Andreas\SA-MP SERVER(CNR)\plugins\streamer.dll)

MSVCP100.dll    A: 0x78050000 - 0x780B9000  (C:\WINDOWS\system32\MSVCP100.dll)

MSVCR100.dll    A: 0x78AA0000 - 0x78B5E000  (C:\WINDOWS\system32\MSVCR100.dll)

sscanf.dll  A: 0x01180000 - 0x0118D000  (C:\Documents and Settings\Karim\My Documents\Grand Theft Auto San Andreas\SA-MP SERVER(CNR)\plugins\sscanf.dll)

irc.dll A: 0x011A0000 - 0x011EC000  (C:\Documents and Settings\Karim\My Documents\Grand Theft Auto San Andreas\SA-MP SERVER(CNR)\plugins\irc.dll)

Whirlpool.dll   A: 0x01300000 - 0x0130C000  (C:\Documents and Settings\Karim\My Documents\Grand Theft Auto San Andreas\SA-MP SERVER(CNR)\plugins\Whirlpool.dll)

MSVCR80.dll A: 0x78130000 - 0x781CB000  (C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.6195_x-ww_44262b86\MSVCR80.dll)

regex.dll   A: 0x01330000 - 0x01361000  (C:\Documents and Settings\Karim\My Documents\Grand Theft Auto San Andreas\SA-MP SERVER(CNR)\plugins\regex.dll)

MSVCR90.dll A: 0x78520000 - 0x785C3000  (C:\WINDOWS\WinSxS\x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.30729.6161_x-ww_31a54e43\MSVCR90.dll)

MSVCP90.dll A: 0x78480000 - 0x7850E000  (C:\WINDOWS\WinSxS\x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.30729.6161_x-ww_31a54e43\MSVCP90.dll)

dbghelp.dll A: 0x59A60000 - 0x59B01000  (C:\WINDOWS\system32\dbghelp.dll)

VERSION.dll A: 0x77C00000 - 0x77C08000  (C:\WINDOWS\system32\VERSION.dll)

nativechecker.dll   A: 0x014E0000 - 0x014E5000  (C:\Documents and Settings\Karim\My Documents\Grand Theft Auto San Andreas\SA-MP SERVER(CNR)\plugins\nativechecker.dll)

hnetcfg.dll A: 0x662B0000 - 0x66308000  (C:\WINDOWS\system32\hnetcfg.dll)

wshtcpip.dll    A: 0x71A90000 - 0x71A98000  (C:\WINDOWS\System32\wshtcpip.dll)

uxtheme.dll A: 0x5AD70000 - 0x5ADA8000  (C:\WINDOWS\system32\uxtheme.dll)

MSCTF.dll   A: 0x74720000 - 0x7476C000  (C:\WINDOWS\system32\MSCTF.dll)

netapi32.dll    A: 0x5B860000 - 0x5B8B5000  (C:\WINDOWS\system32\netapi32.dll)

appHelp.dll A: 0x77B40000 - 0x77B62000  (C:\WINDOWS\system32\appHelp.dll)

CLBCATQ.DLL A: 0x76FD0000 - 0x7704F000  (C:\WINDOWS\system32\CLBCATQ.DLL)

COMRes.dll  A: 0x77050000 - 0x77115000  (C:\WINDOWS\system32\COMRes.dll)

OLEAUT32.dll    A: 0x77120000 - 0x771AB000  (C:\WINDOWS\system32\OLEAUT32.dll)

iertutil.dll    A: 0x3DFD0000 - 0x3E1BC000  (C:\WINDOWS\system32\iertutil.dll)

urlmon.dll  A: 0x03800000 - 0x03934000  (C:\WINDOWS\system32\urlmon.dll)

MSImg32.dll A: 0x76380000 - 0x76385000  (C:\WINDOWS\system32\MSImg32.dll)

SETUPAPI.dll    A: 0x77920000 - 0x77A13000  (C:\WINDOWS\system32\SETUPAPI.dll)
Reply

I'll soon release gamemode with R35 (I'm quite sure that orm_delvar and mysql_pquery will play a major role in that) - I really hope people will finally move from non-threaded queries!
Reply

Quote:
Originally Posted by CKA3KuH
Посмотреть сообщение
Bug here!

mysql_set_charset("cp1251") doesn't work in R35 with mysql_tquery or mysql_pquery. Fix it pls.

Код:
[23:34:43] [DEBUG] cache_get_row_count - connection: 1
[23:34:43] [DEBUG] mysql_set_charset - charset: "cp1251", connection: 1
[23:34:43] [DEBUG] orm_create - table: "hints", connectionHandle: 1
[23:34:43] [DEBUG] COrm::Create - creating new orm object..
[23:34:43] [DEBUG] COrm::Create - orm object created (id: 1)
[23:34:43] [DEBUG] orm_addvar - orm_id: 1, var: 02A15D20, datatype: 0, varname: "id", var_maxlen: 1
[23:34:43] [DEBUG] orm_setkey - orm_id: 1, varname: "id"
[23:34:43] [DEBUG] orm_addvar - orm_id: 1, var: 02A15D48, datatype: 2, varname: "description", var_maxlen: 55
[23:34:43] [DEBUG] orm_apply_cache - orm_id: 1, row: 0
[23:34:43] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "description", data: "??????? ??????? ? 2-? ???????? ????????"
[23:34:43] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "id", data: "1"
Use query
SET NAMES cp1251;
SET SESSION character_set_server='cp1251';
Reply

Quote:
Originally Posted by Xotab
Посмотреть сообщение
Use query
SET NAMES cp1251;
SET SESSION character_set_server='cp1251';
Код:
[04:03:26] [DEBUG] mysql_set_charset - charset: "cp1251", connection: 1
[04:03:26] [DEBUG] mysql_query - connection: 1, query: "SET NAMES cp1251;", use_cache: false
[04:03:26] [DEBUG] CMySQLQuery::Execute - starting query execution
[04:03:26] [DEBUG] CMySQLQuery::Execute - query was successful
[04:03:26] [DEBUG] CMySQLResult::CMySQLResult() - constructor called
[04:03:26] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called
[04:03:26] [DEBUG] mysql_query - connection: 1, query: "SET SESSION character_set_server='cp1251';", use_cache: false
[04:03:26] [DEBUG] CMySQLQuery::Execute - starting query execution
[04:03:26] [DEBUG] CMySQLQuery::Execute - query was successful
[04:03:26] [DEBUG] CMySQLResult::CMySQLResult() - constructor called
[04:03:26] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called


[04:03:26] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "description", data: "??????? ??????? ? 2-? ???????? ????????"
Reply

I had very strange results with R35 on a simple SELECT query:

Код:
[00:23:11] [DEBUG] cache_get_field_content_int - row: 0, field_name: "kills", connection: 1
[00:23:11] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "kills", data: "1"
[00:23:11] [DEBUG] cache_get_field_content_int - row: 0, field_name: "score", connection: 1
[00:23:11] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "score", data: "1"
[00:23:11] [DEBUG] cache_get_field_content_int - row: 0, field_name: "captures", connection: 1
[00:23:11] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "captures", data: "0"
[00:23:11] [DEBUG] cache_get_field_content_int - row: 0, field_name: "defenses", connection: 1
[00:23:11] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "defenses", data: "0"
[00:23:11] [DEBUG] cache_get_field_content_int - row: 0, field_name: "destructions", connection: 1
[00:23:11] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "destructions", data: "0"
[00:23:11] [DEBUG] cache_get_field_content_int - row: 0, field_name: "assists", connection: 1
[00:23:11] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "assists", data: "0"
[00:23:11] [DEBUG] cache_get_field_content_float - row: 0, field_name: "damagedealt", connection: 1
[00:23:11] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "damagedealt", data: "0"
[00:23:11] [DEBUG] cache_get_field_content_float - row: 0, field_name: "healed", connection: 1
[00:23:11] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "healed", data: "0"
[00:23:11] [DEBUG] cache_get_field_content_int - row: 0, field_name: "saps", connection: 1
[00:23:11] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "saps", data: "0"
[00:23:11] [DEBUG] cache_get_field_content_int - row: 0, field_name: "backstabs", connection: 1
[00:23:11] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "backstabs", data: "0"
[00:23:11] [DEBUG] cache_get_field_content_int - row: 0, field_name: "constructions", connection: 1
[00:23:11] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "constructions", data: "0"
[00:23:11] [DEBUG] cache_get_field_content_int - row: 0, field_name: "headshoots", connection: 1
[00:23:11] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "headshoots", data: "0"
[00:23:11] [DEBUG] cache_get_field_content_int - row: 0, field_name: "ubers", connection: 1
[00:23:11] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "ubers", data: "0"
[00:23:11] [DEBUG] cache_get_field_content_int - row: 0, field_name: "time", connection: 1
[00:23:11] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "time", data: "0"
And

Код:
00:23:11] [DEBUG] cache_get_field_content - row: 0, field_name: "kills", connection: 1, max_len: 12
[00:23:11] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "kills", data: "0"
[00:23:11] [DEBUG] cache_get_field_content - row: 0, field_name: "score", connection: 1, max_len: 12
[00:23:11] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "score", data: "0"
[00:23:11] [DEBUG] cache_get_field_content - row: 0, field_name: "captures", connection: 1, max_len: 12
[00:23:11] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "captures", data: "0"
[00:23:11] [DEBUG] cache_get_field_content - row: 0, field_name: "defenses", connection: 1, max_len: 12
[00:23:11] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "defenses", data: "0"
[00:23:11] [DEBUG] cache_get_field_content - row: 0, field_name: "destructions", connection: 1, max_len: 12
[00:23:11] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "destructions", data: "0"
[00:23:11] [DEBUG] cache_get_field_content - row: 0, field_name: "assists", connection: 1, max_len: 12
[00:23:11] [DEBUG] CMySQLQuery::Execute[] - starting query execution
[00:23:11] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "assists", data: "0"
[00:23:11] [DEBUG] cache_get_field_content - row: 0, field_name: "damagedealt", connection: 1, max_len: 12
[00:23:11] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "damagedealt", data: "0"
[00:23:11] [DEBUG] cache_get_field_content - row: 0, field_name: "healed", connection: 1, max_len: 12
[00:23:11] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "healed", data: "0"
[00:23:11] [DEBUG] cache_get_field_content - row: 0, field_name: "saps", connection: 1, max_len: 12
[00:23:11] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "saps", data: "0"
[00:23:11] [DEBUG] cache_get_field_content - row: 0, field_name: "backstabs", connection: 1, max_len: 12
[00:23:11] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "backstabs", data: "0"
[00:23:11] [DEBUG] cache_get_field_content - row: 0, field_name: "constructions", connection: 1, max_len: 12
[00:23:11] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "constructions", data: "0"
[00:23:11] [DEBUG] cache_get_field_content - row: 0, field_name: "headshoots", connection: 1, max_len: 12
[00:23:11] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "headshoots", data: "0"
[00:23:11] [DEBUG] cache_get_field_content - row: 0, field_name: "ubers", connection: 1, max_len: 12
[00:23:11] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "ubers", data: "0"
[00:23:11] [DEBUG] cache_get_field_content - row: 0, field_name: "time", connection: 1, max_len: 12
[00:23:11] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "time", data: "0"
[00:23:11] [DEBUG] cache_get_field_content - row: 0, field_name: "criticals", connection: 1, max_len: 12
[00:23:11] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "criticals", data: "2"
[00:23:11] [DEBUG] cache_get_field_content - row: 0, field_name: "victories", connection: 1, max_len: 12
[00:23:11] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "victories", data: "6"
(The last one used cache_get_field_content_int but I changed it in order to see if the problem was with the function itself (it wasn't) )

And these are the DB and it's values:




It did work for the char_id with the class NOT NULL

Код:
[00:23:13] [DEBUG] cache_get_field_content_int - row: 0, field_name: "time", connection: 1
[00:23:13] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "time", data: "565"
[00:23:13] [DEBUG] cache_get_field_content_int - row: 0, field_name: "score", connection: 1
[00:23:13] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "score", data: "0"
[00:23:13] [DEBUG] cache_get_field_content_int - row: 0, field_name: "kills", connection: 1
[00:23:13] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "kills", data: "0"
[00:23:13] [DEBUG] cache_get_field_content_int - row: 0, field_name: "captures", connection: 1
[00:23:13] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "captures", data: "0"
[00:23:13] [DEBUG] cache_get_field_content_int - row: 0, field_name: "destructions", connection: 1
[00:23:13] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "destructions", data: "0"
[00:23:13] [DEBUG] cache_get_field_content_int - row: 0, field_name: "assists", connection: 1
[00:23:13] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "assists", data: "0"
[00:23:13] [DEBUG] cache_get_field_content_int - row: 0, field_name: "defenses", connection: 1
[00:23:13] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "defenses", data: "0"
[00:23:13] [DEBUG] cache_get_field_content_float - row: 0, field_name: "damagedealt", connection:
These are the codes:

pawn Код:
stock LoadClassStats(playerid,classe, char_id)
{
    if(GetPVarInt(playerid,"AccountLevel") == 0)
        return 1;

    mysql_format(dbHandle, query, 128, "SELECT * FROM `stats` WHERE `char_id` = %d AND `type` = 2 AND `class` = '%d' ", char_id ,classe);
    mysql_tquery(dbHandle,query,"OnPlayerClassStatsLoad","ii",playerid,classe);
    return 1;
}

stock LoadLiveStats(playerid, char_id)
{
    if(GetPVarInt(playerid,"AccountLevel") == 0)
        return 1;

    mysql_format(dbHandle, query, 128, "SELECT * FROM `stats` WHERE `char_id` = '%d' AND `type` = 1",char_id);
    mysql_tquery(dbHandle,query,"OnPlayerLiveStatsLoad","i",playerid);
    return 1;
}



stock LoadStats(playerid, char_id)
{
    if(GetPVarInt(playerid,"AccountLevel") == 0)
        return 1;

    mysql_format(dbHandle, query, 128, "SELECT * FROM `stats` WHERE `char_id` = '%d' AND `type` = 0",char_id);
    mysql_tquery(dbHandle,query,"OnPlayerGlobalStatsLoad","i",playerid);

    return 1;
}

forward OnPlayerClassStatsLoad(playerid,class);
public OnPlayerClassStatsLoad(playerid,class)
{
    new rows, fields;
    cache_get_data(rows, fields);
    if(!rows)
    {
        if(GetPVarInt(playerid,"AccountLevel") >= 1)
            TDError(playerid, "Could not load your class stats, contact the administrator.");
        return 1;
    }

    if(class == SCOUT)
        SetPVarInt(playerid, "PlayedScout",cache_get_field_content_int(0, "time"));
    else if(class == PYRO)
        SetPVarInt(playerid, "PlayedPyro",cache_get_field_content_int(0, "time"));
    else if(class == SOLDIER)
        SetPVarInt(playerid, "PlayedSoldier",cache_get_field_content_int(0, "time"));
    else if(class == DEMOMAN)
        SetPVarInt(playerid, "PlayedDemoman",cache_get_field_content_int(0, "time"));
    else if(class == HEAVY)
        SetPVarInt(playerid, "PlayedHeavy",cache_get_field_content_int(0, "time"));
    else if(class == ENGINEER)
        SetPVarInt(playerid, "PlayedEngineer",cache_get_field_content_int(0, "time")),
        SetPVarInt(playerid, "CurrClassConstructions",cache_get_field_content_int(0, "constructions"));
    else if(class == MEDIC)
        SetPVarInt(playerid, "PlayedMedic",cache_get_field_content_int(0, "time")),
        SetPVarFloat(playerid, "CurrClassHealed",cache_get_field_content_float(0, "healed")),
        SetPVarInt(playerid, "CurrClassUbers",cache_get_field_content_int(0, "ubers"));
    else if(class == SPY)
        SetPVarInt(playerid, "PlayedSpy",cache_get_field_content_int(0, "time")),
        SetPVarInt(playerid, "CurrClassBackstabs",cache_get_field_content_int(0, "backstabs")),
        SetPVarInt(playerid, "CurrClassSaps",cache_get_field_content_int(0, "saps"));
    else if(class == SNIPER)
        SetPVarInt(playerid, "PlayedSniper",cache_get_field_content_int(0, "time")),
        SetPVarInt(playerid, "CurrClassHeadshoots",cache_get_field_content_int(0, "headshoots"));

    SetPVarInt(playerid, "CurrClassScore", cache_get_field_content_int(0, "score"));
    SetPVarInt(playerid, "CurrClassVictims", cache_get_field_content_int(0, "kills"));
    SetPVarInt(playerid, "CurrClassCaptures", cache_get_field_content_int(0, "captures"));
    SetPVarInt(playerid, "CurrClassDestroyed", cache_get_field_content_int(0, "destructions"));
    SetPVarInt(playerid, "CurrClassAssists", cache_get_field_content_int(0, "assists"));
    SetPVarInt(playerid, "CurrClassDefenses", cache_get_field_content_int(0, "defenses"));
    SetPVarFloat(playerid, "CurrClassDamage",cache_get_field_content_float(0, "damagedealt"));
    return 1;
}

forward OnPlayerGlobalStatsLoad(playerid);
public OnPlayerGlobalStatsLoad(playerid)
{
    new rows, fields;
    cache_get_data(rows, fields);
    if(!rows)
    {
        if(GetPVarInt(playerid,"AccountLevel") >= 1)
            TDError(playerid, "Could not load your global stats, contact the administrator.");

        return 1;
    }
    SetPVarInt(playerid, "Kills", cache_get_field_content_int(0, "kills"));
    SetPVarInt(playerid, "Score", cache_get_field_content_int(0, "score"));
    SetPVarInt(playerid, "Captures", cache_get_field_content_int(0, "captures"));
    SetPVarInt(playerid, "Defenses", cache_get_field_content_int(0, "defenses"));
    SetPVarInt(playerid, "Destroyed", cache_get_field_content_int(0, "destructions"));
    SetPVarInt(playerid, "Assists", cache_get_field_content_int(0, "assists"));
    SetPVarFloat(playerid, "DamageDone", cache_get_field_content_float(0, "damagedealt"));
    SetPVarFloat(playerid, "HPHealed", cache_get_field_content_float(0, "healed"));
    SetPVarInt(playerid, "Sapped", cache_get_field_content_int(0, "saps"));
    SetPVarInt(playerid, "Backstabs", cache_get_field_content_int(0, "backstabs"));
    SetPVarInt(playerid, "Constructions", cache_get_field_content_int(0, "constructions"));
    SetPVarInt(playerid, "Headshoots", cache_get_field_content_int(0, "headshoots"));
    SetPVarInt(playerid, "Ubers", cache_get_field_content_int(0, "ubers"));
    SetPVarInt(playerid, "PlayingSecs", cache_get_field_content_int(0, "time"));
    SetPVarInt(playerid, "Criticals", cache_get_field_content_int(0, "criticals"));
    SetPVarInt(playerid, "Victories", cache_get_field_content_int(0, "victories"));
    return 1;
}

forward OnPlayerLiveStatsLoad(playerid);
public OnPlayerLiveStatsLoad(playerid)
{
    new rows, fields;
    cache_get_data(rows, fields);
    if(!rows)
    {
        if(GetPVarInt(playerid,"AccountLevel") >= 1)
            TDError(playerid, "Could not load your live stats, contact the administrator.");

        return 1;
    }
   
    SetPVarInt(playerid, "LiveVictims", cache_get_field_content_int(0, "kills"));
    SetPVarInt(playerid, "LiveScore", cache_get_field_content_int(0, "score"));
    SetPVarInt(playerid, "LiveCaptures", cache_get_field_content_int(0, "captures"));
    SetPVarInt(playerid, "LiveDefenses", cache_get_field_content_int(0, "defenses"));
    SetPVarInt(playerid, "LiveDestroyed", cache_get_field_content_int(0, "destructions"));
    SetPVarInt(playerid, "LiveAssists", cache_get_field_content_int(0, "assists"));
    SetPVarFloat(playerid, "LiveDamage", cache_get_field_content_float(0, "damagedealt"));
    SetPVarFloat(playerid, "LiveHealed", cache_get_field_content_float(0, "healed"));
    SetPVarInt(playerid, "LiveSaps", cache_get_field_content_int(0, "saps"));
    SetPVarInt(playerid, "LiveBackstabs", cache_get_field_content_int(0, "backstabs"));
    SetPVarInt(playerid, "LiveConstructions", cache_get_field_content_int(0, "constructions"));
    SetPVarInt(playerid, "LiveHeadshoots", cache_get_field_content_int(0, "headshoots"));
    SetPVarInt(playerid, "LiveUbers", cache_get_field_content_int(0, "ubers"));
    SetPVarInt(playerid, "LiveSecs", cache_get_field_content_int(0, "time"));
    return 1;
}
It is not a fault in my code I believe, because with the very same code it works perfectly at R34.

Код:
[00:31:42] [DEBUG] cache_get_field_content_int - row: 0, field_name: "kills", connection: 1
[00:31:42] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "kills", data: "0"
[00:31:42] [DEBUG] cache_get_field_content_int - row: 0, field_name: "score", connection: 1
[00:31:42] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "score", data: "1"
[00:31:42] [DEBUG] cache_get_field_content_int - row: 0, field_name: "captures", connection: 1
[00:31:42] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "captures", data: "0"
[00:31:42] [DEBUG] cache_get_field_content_int - row: 0, field_name: "defenses", connection: 1
[00:31:42] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "defenses", data: "0"
[00:31:42] [DEBUG] cache_get_field_content_int - row: 0, field_name: "destructions", connection: 1
[00:31:42] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "destructions", data: "0"
[00:31:42] [DEBUG] cache_get_field_content_int - row: 0, field_name: "assists", connection: 1
[00:31:42] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "assists", data: "0"
[00:31:42] [DEBUG] cache_get_field_content_float - row: 0, field_name: "damagedealt", connection: 1
[00:31:42] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "damagedealt", data: "0"
[00:31:42] [DEBUG] cache_get_field_content_float - row: 0, field_name: "healed", connection: 1
[00:31:42] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "healed", data: "0"
[00:31:42] [DEBUG] cache_get_field_content_int - row: 0, field_name: "saps", connection: 1
[00:31:42] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "saps", data: "0"
[00:31:42] [DEBUG] cache_get_field_content_int - row: 0, field_name: "backstabs", connection: 1
[00:31:42] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "backstabs", data: "0"
[00:31:42] [DEBUG] cache_get_field_content_int - row: 0, field_name: "constructions", connection: 1
[00:31:42] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "constructions", data: "0"
[00:31:42] [DEBUG] cache_get_field_content_int - row: 0, field_name: "headshoots", connection: 1
[00:31:42] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "headshoots", data: "0"
[00:31:42] [DEBUG] cache_get_field_content_int - row: 0, field_name: "ubers", connection: 1
[00:31:42] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "ubers", data: "0"
[00:31:42] [DEBUG] cache_get_field_content_int - row: 0, field_name: "time", connection: 1
[00:31:42] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "time", data: "297"
[00:31:42] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called
[00:31:42] [DEBUG] CMySQLQuery::~CMySQLQuery() - deconstructor called
[00:31:42] [DEBUG] Calling callback "OnPlayerGlobalStatsLoad"..
[00:31:42] [DEBUG] cache_get_data - connection: 1
[00:31:42] [DEBUG] cache_get_field_content_int - row: 0, field_name: "kills", connection: 1
[00:31:42] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "kills", data: "0"
[00:31:42] [DEBUG] cache_get_field_content_int - row: 0, field_name: "score", connection: 1
[00:31:42] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "score", data: "0"
[00:31:42] [DEBUG] cache_get_field_content_int - row: 0, field_name: "captures", connection: 1
[00:31:42] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "captures", data: "0"
[00:31:42] [DEBUG] cache_get_field_content_int - row: 0, field_name: "defenses", connection: 1
[00:31:42] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "defenses", data: "0"
[00:31:42] [DEBUG] cache_get_field_content_int - row: 0, field_name: "destructions", connection: 1
[00:31:42] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "destructions", data: "0"
[00:31:42] [DEBUG] cache_get_field_content_int - row: 0, field_name: "assists", connection: 1
[00:31:42] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "assists", data: "0"
[00:31:42] [DEBUG] cache_get_field_content_float - row: 0, field_name: "damagedealt", connection: 1
[00:31:42] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "damagedealt", data: "0"
[00:31:42] [DEBUG] cache_get_field_content_float - row: 0, field_name: "healed", connection: 1
[00:31:42] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "healed", data: "0"
[00:31:42] [DEBUG] cache_get_field_content_int - row: 0, field_name: "saps", connection: 1
[00:31:42] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "saps", data: "0"
[00:31:42] [DEBUG] cache_get_field_content_int - row: 0, field_name: "backstabs", connection: 1
[00:31:42] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "backstabs", data: "0"
[00:31:42] [DEBUG] cache_get_field_content_int - row: 0, field_name: "constructions", connection: 1
[00:31:42] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "constructions", data: "0"
[00:31:42] [DEBUG] cache_get_field_content_int - row: 0, field_name: "headshoots", connection: 1
[00:31:42] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "headshoots", data: "0"
[00:31:42] [DEBUG] cache_get_field_content_int - row: 0, field_name: "ubers", connection: 1
[00:31:42] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "ubers", data: "0"
[00:31:42] [DEBUG] cache_get_field_content_int - row: 0, field_name: "time", connection: 1
[00:31:42] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "time", data: "365"
[00:31:42] [DEBUG] cache_get_field_content_int - row: 0, field_name: "criticals", connection: 1
[00:31:42] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "criticals", data: "0"
[00:31:42] [DEBUG] cache_get_field_content_int - row: 0, field_name: "victories", connection: 1
[00:31:42] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "victories", data: "0"
Reply

Already reported CuervO, thanks for the information though it will help pain
Reply

Can anyone make an example of ORM usage because I tried AndreT's tutorial and it doesn't work...
And for some reason when I select data with ORM so if it's a string it duplicates the first and puts it on the next strings i.e:
I have in the database:
ID: 1
Name: Test
Level: 2
Clan: Test Clan
And what ORM shows is:
ID: 1
Name: Test
Level: 1
Clan: Test
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)