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

Quote:
Originally Posted by Jay_
Will there be a mysql_fetch_field_row fix anytime soon?
It was actually a coding fault which led me to beleive this function was not working correctly, sorry.
Reply

Quote:
Originally Posted by michael2572
Why does mysql_fetch_row_format() crash the server if the row string is longer than 200?
I use 1024 and it never happened to me.
Reply

I cba to look thrue 33 pages so im asking , If i'm transfering my PEN LS Edit to MYSQL How to make a save system? You know so it saves in DB not in .INI or i need to leave it as it is?
Reply

Quote:
Originally Posted by »Julian™«
I cba to look thrue 33 pages so im asking , If i'm transfering my PEN LS Edit to MYSQL How to make a save system? You know so it saves in DB not in .INI or i need to leave it as it is?
You need to convert all the file writing to SQL queries and process them.
Reply

Well check 33 pages again. Because there so much info for saving system/
Reply

Quote:
Originally Posted by »Julian™«
I cba to look thrue 33 pages so im asking , If i'm transfering my PEN LS Edit to MYSQL How to make a save system? You know so it saves in DB not in .INI or i need to leave it as it is?
I suggest you reading some guides. Though only changing the users system is not hard at all.
Reply

As i figured it out i had to query "OnplayerUpdate" Soo .. Rest i'll get in touch with as while you script you'll learn more Thanks
Reply

This someties dosent load a players owned vehicle, Anyone know why?

pawn Код:
public LoadVehicles()
{
    CheckSQL();
    new resultline[256],vehid,sqlid,model,Float:x,Float:y,Float:z,Float:angle,col1,col2,type,price,ownerid;
    mysql_query("SELECT * FROM `vehicles`");
    mysql_store_result();
    while(mysql_fetch_row_format(resultline,"|") == 1)
    {
      sscanf(resultline,"p|ddffffddddd",sqlid,model,x,y,z,angle,col1,col2,type,price,ownerid);
        vehid = CreateVehicle(model,x,y,z,angle,col1,col2,-1);
      vInfo[vehid][vSQLId] = sqlid;
      vInfo[vehid][vModelId] = model;
      vInfo[vehid][vPos_X] = x;
      vInfo[vehid][vPos_Y] = y;
      vInfo[vehid][vPos_Z] = z;
      vInfo[vehid][vPos_A] = angle;
      vInfo[vehid][vColor1] = col1;
      vInfo[vehid][vColor2] = col2;
      vInfo[vehid][vBuyAble] = type;
      vInfo[vehid][vPrice] = price;
      vInfo[vehid][vOwnerId] = ownerid;
    }
    mysql_free_result();
    return 1;
}
Reply

[17:14:24] Loading plugin: mysql.so
[17:14:24] Failed (libmysqlclient.so.15: wrong ELF class: ELFCLASS64)
[17:14:24] Loaded 0 plugins.

[17:14:24]
[17:14:24] Filter Scripts
[17:14:24] ---------------
[17:14:24] Loaded 0 filter scripts.

[17:14:24] Script[gamemodes/tbl_dc.amx]: Run time error 19: "File or function is not found"

CentOs 64 bit , Please help
Reply

Quote:
Originally Posted by Hipster
[17:14:24] Loading plugin: mysql.so
[17:14:24] Failed (libmysqlclient.so.15: wrong ELF class: ELFCLASS64)
[17:14:24] Loaded 0 plugins.

[17:14:24]
[17:14:24] Filter Scripts
[17:14:24] ---------------
[17:14:24] Loaded 0 filter scripts.

[17:14:24] Script[gamemodes/tbl_dc.amx]: Run time error 19: "File or function is not found"

CentOs 64 bit , Please help
I can suggest one thing > try mine files(CentOS too)
http://t2play.info/mysql.so
http://t2play.info/libmysqlclient.so
Reply

Does anyone by any chance have an older version of this (namely, the one that worked on 0.2x servers)
Reply

Yes. AFAIK sscanf has bugs with floats, it happened to me too.
Reply

Just replace case f with this and it will work.
pawn Код:
case 'f':
            {
              new changestr[16], changepos = 0, strpos = stringPos;
                while(changepos < 16 && string[strpos] && string[strpos] != delim)
                {
                changestr[changepos++] = string[strpos++];
              }
              changestr[changepos] = '\0';
              setarg(paramPos,0,_:floatstr(changestr));
            }
Reply

Does anyone know when R3 will be released? Because i think that in R3 plugin author fix bug with RAM usage.. or fix mysql_free_result()..
Reply

R3 is being tested. And yes those functions will be fixed as well as some new functions added.
Reply

I wish that it would be released as soon as possible It's annoying to restart server every day :\
Reply

I got a problem with retreiving string in my mysql DB. I can retreive a string without problem (Log confirm it: 08:26:37] mysql_fetch_row_format(Delimiter: ); Return: "Test") but the problem is the transfer in a variable. Is never show a string. It show a face.....

Here's the part of my script:
pawn Код:
new BizzName[500];
format(query,sizeof(query),"SELECT name FROM bizz WHERE id='%i'",i);
mysql_query(query);
mysql_store_result();
BizzName[i] = mysql_fetch_row(line);
printf("Business %s loaded. Owner: %4s",BizzName[i]);
Thanks for your help
Greatman
Reply

It should be
pawn Код:
new BizzName[your max businesses][length of string];
Reply

Quote:
Originally Posted by MenaceX^
It should be
pawn Код:
new BizzName[your max businesses][length of string];
Thanks but now i get the error: error 033: array must be indexed (variable "BizzName")

I need to do that?:

pawn Код:
BizzName[i][length of string] = mysql_fetch_row(line);
Reply

Код:
native mysql_fetch_row_format(string[],const delimiter[] = "|");
#define mysql_fetch_row(%1) mysql_fetch_row_format(%1," ")
You need to give it a (pointer/reference to) variable, which you want to store the data.

Код:
mysql_fetch_row(BizzName[i]);
Remember to have enough memory allocated for the returned string.
Reply


Forum Jump:


Users browsing this thread: 13 Guest(s)