SA-MP Forums Archive
[Plugin] [REL] MySQL Plugin (Now on github!) - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Plugin Development (https://sampforum.blast.hk/forumdisplay.php?fid=18)
+--- Thread: [Plugin] [REL] MySQL Plugin (Now on github!) (/showthread.php?tid=56564)



Re: [REL] MySQL Plugin (****** Project) - Scenario - 11.08.2013

I have a table that has 1030 rows in it that doesn't seem to load on my Linux box. It won't even return any rows. However, all of the other MySQL stuff seems to work completely fine so I don't see what the problem is. Loading the table on a 15 second timer seemed to do the trick, but why would I have to do that when I didn't have to do that in the past? Could it be due to the multithreading..?

Quote:

Loading plugin: mysql.so
[17:36:36] >> plugin.mysql: running on 1 thread.
[17:36:36] >> plugin.mysql: R31 successfully loaded.
[17:36:36]




Re: [REL] MySQL Plugin (****** Project) - QuaTTrO - 13.08.2013

How can i check that connection is alive in version R31? There is no mysql_ping function.
And what does this function?:
pawn Код:
mysql_tquery(connectionHandle, query[], callback[], format[], {Float,_}:...);



Re: [REL] MySQL Plugin (****** Project) - []Allex[] - 13.08.2013

mysql_tquery(connectionHandle, query[], callback[], format[], {Float,_}:...);

is like mysql_function_query and mysql_tquery hasn't the parameter bool: .

Ex:

pawn Код:
new Query[ 256 ];
format( Query, sizeof Query, "SELECT `Name` FROM `Users` WHERE `Id` = %d", GetPlayerId( playerid ) );
mysql_tquery( 1, Query, "", "" );
And mysql_ping was removed . You can go at OnQueryError and add this:

pawn Код:
switch( errorid )
{
     case 2006: print( "Couldn't connect to database" );
}



Re: [REL] MySQL Plugin (****** Project) - QuaTTrO - 13.08.2013

But tquery allow to read data using cache functions ?


Re: [REL] MySQL Plugin (****** Project) - IstuntmanI - 13.08.2013

Quote:
Originally Posted by QuaTTrO
Посмотреть сообщение
But tquery allow to read data using cache functions ?
It is exactly like mysql_function_query, but the bool:cache parameter has been removed. Just transform it. (the MySQL include also has an wrapper for mysql_function_query)


Re: [REL] MySQL Plugin (****** Project) - Scenario - 13.08.2013

I'm running the dynamic version of R31. My MySQL server version is 5.1.69.


Re: [REL] MySQL Plugin (****** Project) - Sp3cter - 13.08.2013

When r33 will be released ?


Re: [REL] MySQL Plugin (****** Project) - maddinat0r - 13.08.2013

Quote:
Originally Posted by Sp3cter
Посмотреть сообщение
When r33 will be released ?
Quote:
Originally Posted by Pain123
Посмотреть сообщение
It [...] depends on when the tutorial for the ORM system will be done and how long one of my beta testers needs to test new beta versions because of an evil bug.
4char


Re: [REL] MySQL Plugin (****** Project) - John_Tylor - 14.08.2013

Great job


Re: [REL] MySQL Plugin (****** Project) - nickdodd25 - 14.08.2013

So im in the process of updating the MySQL plugin from r7 to the newest version r31 currently running centos 5.9 and i keep getting this error...

Код:
[16:13:40]   Failed (/usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.9' not found (required by plugins/mysql_static.so))
That error is from the static build, i also have libstdc++.so.6 installed...


What should i do from here?

I also tried the dynamic(not the static build one) and i get.....
Код:
[16:51:05]   Failed (/usr/lib/libmysqlclient_r.so.16: version `libmysqlclient_16' not found (required by plugins/mysql.so))
I assume there is something wrong since that is white in the ls command results.


Re: [REL] MySQL Plugin (****** Project) - Richie© - 16.08.2013

Quote:
Originally Posted by Kar
Посмотреть сообщение
Which version is this?

I have this issue also, the rows would return -1 so thats how I know how to fix it, try my fix. Yes it only happens on linux.

pawn Код:
if(rows == -1) {
        printf("[System: LoadHousesFromDatabase:: FAILED] - Reattempting");
        LoadHousesFromDatabase();
    }
    else { // Passed, do stuff now
        CalculateMillLevy();
        CheckHouseLastVisits();
    }
I had same problem with R31, it wouldnt load vehicles (900+ rows) or count number of accounts, sometimes. This was very annoying as i had to restart server. I didnt care to apply this fix, i just downgraded to R26.


Re: [REL] MySQL Plugin (****** Project) - .Mento - 17.08.2013

I've installed R31, but it tells me: undefined symbol "mysql_ping"

Why does it? It didn't do this before.


Re: [REL] MySQL Plugin (****** Project) - d711728 - 17.08.2013

Hello!

Someone would write an example R31 PLUGIN:
native cache_affected_rows (connectionHandle = 1);
native cache_insert_id (connectionHandle = 1);

Use these two functions?
I always return a value of zero.
I tried this way:

format (string, sizeof (string), "% d blalala, cache_affected_rows (connectionHandle = 1)


Sorry bad, English..


Re: [REL] MySQL Plugin (****** Project) - -Prodigy- - 18.08.2013

Pain, is it possible to run a query before the server exits?


--
Quote:
Originally Posted by .Mento
Посмотреть сообщение
I've installed R31, but it tells me: undefined symbol "mysql_ping"

Why does it? It didn't do this before.
I THINK this function was removed.


Re: [REL] MySQL Plugin (****** Project) - Scenario - 18.08.2013

@Prodigy: If the connection to the MySQL server doesn't even exist, how do you expect to run a query? What would be the point...?

@.Mento: Yes, mysql_ping has been removed. Take a look at some of the examples in the previous pages of using mysql_errno to determine if the connection to the MySQL server succeeded or not.

@d711728: You're pretty much doing it correctly. This would be the correct way:

pawn Код:
format(string, sizeof(string), "%d rows were affected.", cache_affected_rows());



Re: [REL] MySQL Plugin (****** Project) - d711728 - 18.08.2013

Okey,thx.


AW: [REL] MySQL Plugin (****** Project) - ThomasTailor93 - 22.08.2013

Maybe I found a little bug while using y_inline on your plugin.

Using a string in "mysql_tquery_inline(1,Query,using inline EditRaceInline,"iis",playerid,id,racename);" (string -> racename) and calling it in the inline func "inline EditRaceInline(pid,edit_id,string:namerace[])" will output only the first letter of the string.

Exampe: sardupdate as racename will output in Inline as "s".

So, is it a bug?


Re: [REL] MySQL Plugin (****** Project) - x96664 - 23.08.2013

I've tried to run a R-31 compiled gamemode, it compiles it without a problem but when I startup samp server.exe I'm getting this error:





Re: [REL] MySQL Plugin (****** Project) - Johnson_boy - 23.08.2013

Quote:
Originally Posted by x96664
Посмотреть сообщение
I've tried to run a R-31 compiled gamemode, it compiles it without a problem but when I startup samp server.exe I'm getting this error:


You need Visual C++ Redistributable

http://www.microsoft.com/en-us/downl....aspx?id=30679


Re: [REL] MySQL Plugin (****** Project) - x96664 - 23.08.2013

Edit: Problem solved! (I forgot to install one of these).