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

@Misiur: yes....
Reply

Problem Solved, i remove msvcr110.dll and msvcp110.dll from my System32 and SysWOW64 and then i remove all VCREDISTs and reinstall them and it's now solved thanks guys
Reply

i am getting this ERROR after updating from version 20 to 34
Код:
[21:17:13] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[21:17:13] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[21:17:13] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[21:17:13] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[21:17:13] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[21:17:13] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[21:17:13] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[21:17:13] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[21:17:13] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[21:17:13] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[21:17:13] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[21:17:13] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
can you please tell me what does it mean?
Reply

You are somewhere using "cache_get_field_content(_int/_float)" with a wrong row index (the first parameter).
Reply

oh, you are right, thanks
Reply

I download the latest plugin, and now when i downloaded it, i see 3 three plugins, mysql.so, mysql_5.5.so, mysql_static.so . Which is newest?
Reply

Quote:
Originally Posted by audriuxxx
Посмотреть сообщение
I download the latest plugin, and now when i downloaded it, i see 3 three plugins, mysql.so, mysql_5.5.so, mysql_static.so . Which is newest?
They are all the same version. It depends on what mysql server version you have installed. For 5.5 try mysql_5.5.so. Otherwise mysql.so or mysql_static.so.
Reply

Hi,

Is this a bug ?

Код:
	cache_get_field_content(0, "RaisonBan", pInfo[playerid][RaisonBan], mysql, 129);
    printf("%s", pInfo[playerid][RaisonBan]);
    pInfo[playerid][ID] = cache_get_row_int(0, 0);
    pInfo[playerid][Admin] = cache_get_row_int(0, 5);
    pInfo[playerid][VIP] = cache_get_row_int(0, 6); 
    pInfo[playerid][Argent] = cache_get_row_int(0, 7);
    pInfo[playerid][posX] = cache_get_row_float(0, 8);
    pInfo[playerid][posY] = cache_get_row_float(0, 9);
    pInfo[playerid][posZ] = cache_get_row_float(0, 10);
    pInfo[playerid][Interieur] = cache_get_row_int(0, 11);
    pInfo[playerid][World] = cache_get_row_int(0, 12);
    pInfo[playerid][Skin] = cache_get_row_int(0, 13);
    pInfo[playerid][Niveau] = cache_get_row_int(0, 14);
    pInfo[playerid][Bannis] = cache_get_row_int(0, 16);
    pInfo[playerid][Vie] = cache_get_row_float(0, 18);
    pInfo[playerid][Armure] = cache_get_row_float(0, 19);
    printf("%s", pInfo[playerid][RaisonBan]);
For the first printf it shows me the realy reason "vrabrohrvraoq"
But for the second printf, I don't know why, it only shows the first letter of the reason and it shows "v".


Do you know why and how could I solve this ?
Reply

Are you sure this is the complete code you posted? There is absolutely no way the cache_get_row_* natives could affect any other variables.
Reply

Here's my code: http://pastebin.com/KJXZ9W3h
Reply

That "RaisonBan" enum entry isn't declared as an array, so your problem is in line 105.
Reply

Thank you, I'm gonna try to solve this.

But have you an idea of this:

for the first printf, it shows the reason
but for the second it doesn't shows the reason exept the first letter of the reason.

Thank you
Reply

It's like that because the ban reason is the first thing you assign to your player enum array. At that time the enum-array is empty and the ban reason string overwrites memory. After printing the ban reason for the first time, you assign all other values to your enum-array, thus overwriting the ban reason string with those values, except for one char, because you still have that "BanRaison" enum-entry there.
Reply

Thank you for the explanations and sorry for the PM.
Reply

I'm looking into COrm.cpp - would it be possible to change SVarInfo struct "name" field after adding it? Either by introducing orm_removevar, or orm_renamevar? I'm thinking about joined queries (using orm_apply_cache), where field names have prefixes, but later on they don't need one for updating.
Reply

it will be good if you add func to cancel scheduled queries with some id or something.
Reply

Quote:
Originally Posted by Misiur
Посмотреть сообщение
I'm looking into COrm.cpp - would it be possible to change SVarInfo struct "name" field after adding it? Either by introducing orm_removevar, or orm_renamevar? I'm thinking about joined queries (using orm_apply_cache), where field names have prefixes, but later on they don't need one for updating.
Here you go: https://github.com/pBlueG/SA-MP-MySQ...8199286f85f5bf

Quote:
Originally Posted by RedCrossER
Посмотреть сообщение
it will be good if you add func to cancel scheduled queries with some id or something.
This would be very hard to implement and wouldn't make any sense. Do you seriously think you can cancel a query fast enough before it is executed? We're talking about milliseconds here.
Reply

You rock!
Reply

I do not know if it has already been suggested or if it is possible but I would like a function that checks if the plugin is connected to the server.

like:
pawn Код:
native mysql_isconnected(connectionHandle = 1);
Reply

Quote:
Originally Posted by Top Fuel
Посмотреть сообщение
I do not know if it has already been suggested or if it is possible but I would like a function that checks if the plugin is connected to the server.

like:
pawn Код:
native mysql_isconnected(connectionHandle = 1);
You have to assume that it is connected. If it isn't, the internal automated reconnect mechanism will be started (unless you deactivate it in mysql_connect and as long as it's a threaded query). For unthreaded functions like mysql_query or mysql_escape_string you'll need to check with mysql_errno.
Reply


Forum Jump:


Users browsing this thread: 9 Guest(s)