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 (Now on github!) - ZeZin - 21.04.2015

Saving mysql datetime date already used in database?


Re: [REL] MySQL Plugin (Now on github!) - caoraivoso3 - 21.04.2015

what? dude i do not save the datetime on mysql. i am just saying that things are saved badly and if that continues i cannot use this plugin because i need to have some reliable save system.


Re: [REL] MySQL Plugin (Now on github!) - hugosousa - 22.04.2015

show us your code.


Re: [REL] MySQL Plugin (Now on github!) - T-N-Z - 23.04.2015

Currently I am rewriting from R6 version to R39-3, so I have small problems.
Does this plugin support TINYINT and SMALLINT? For some reason, some values are getting saved as 0 if the datatype is not a simple INT. If I change them from SMALLINT to INT it works fine. It solves the issue, but should it be that way or what?


Re: [REL] MySQL Plugin (Now on github!) - Konstantinos - 23.04.2015

It does support them. I use them myself when I know for sure the min/max values I'm going to save and I also set the attributes to UNSIGNED (I don't need negative values).

Just make sure it does not exceed the limit and maybe that's why it's saved as 0.


Re: [REL] MySQL Plugin (Now on github!) - norton2 - 23.04.2015

Can someone help me? (MYSQL Update Problem)
https://sampforum.blast.hk/showthread.php?tid=571910


Re: [REL] MySQL Plugin (Now on github!) - Ahmad45123 - 23.04.2015

Hello,
I need to use this on Windows XP but the problem is that it says:
Code:
The procedure entry point IntializeConditionVariable could not be located in the dynamic link library KERNEL32.dll
And after some ******, I found that this problem is that the plugin uses an API which is only available in Windows Vista+.

Is there an old version maybe that doesn't use that API ?


Re: [REL] MySQL Plugin (Now on github!) - Misiur - 23.04.2015

As far as I remember, XP is EOL, and I wouldn't recommend using it at all. But, if you need to do so, you could manually recompile that plugin with:
Code:
#define _WIN32_WINNT 0x502
#include <windows.h>



Re: [REL] MySQL Plugin (Now on github!) - caoraivoso3 - 24.04.2015

Quote:
Originally Posted by caoraivoso3
View Post
well i have a bug to report, i use r39-2 and sometimes some weird shit goes like i crash(it is my client or intended by me to do it) and some variables are saved badly and i say badly because i am on x,y,z and it's saved on 1.23E10 0 0.35, or the money variable goes on rampage with positive or negative values.
It is quite annoying.
It is a bug discovered or something new?
well i use orm system if i didn't mention.
can someone helpme with that? i currently don't have acess to the script but it doesn't give any error on logs and it happens sometimes it's really frustating.


Re: [REL] MySQL Plugin (Now on github!) - maddinat0r - 25.04.2015

I can't say if it's a bug or not if you don't provide any useful information and debug log output. You could try printing the badly saved variables values into the console as a debug message before using "orm_update" or "orm_save".


Re: [REL] MySQL Plugin (Now on github!) - caoraivoso3 - 27.04.2015

Quote:
Originally Posted by maddinat0r
View Post
I can't say if it's a bug or not if you don't provide any useful information and debug log output. You could try printing the badly saved variables values into the console as a debug message before using "orm_update" or "orm_save".
thanks for the response i am away from the script by some time but i am always wondering about this, it happened with two float values the x coordinate and the money(it is float because it is a feature of the server it is intented to be).


Re: [REL] MySQL Plugin (Now on github!) - Luis- - 27.04.2015

Any ideas on this;
pawn Code:
[19:30:30] UnProcessed Queries: 156
I've added it to see how many queries aren't actually being processed and I was amazed at how many aren't.

Does anyone know why this is happening?


Re : [REL] MySQL Plugin (Now on github!) - S4t3K - 27.04.2015

Whiches ones aren't processed then ? And which type of query do you use ? Because even the tqueries are queued but in another thread (anyway they are).


Re: [REL] MySQL Plugin (Now on github!) - iZN - 28.04.2015

Quote:
Originally Posted by Luis-
View Post
Any ideas on this;
pawn Code:
[19:30:30] UnProcessed Queries: 156
I've added it to see how many queries aren't actually being processed and I was amazed at how many aren't.

Does anyone know why this is happening?
They are queued, have you re-checked the count after some more milliseconds (or second, minute according to your query)? Also, are you using threaded queries?


Re: [REL] MySQL Plugin (Now on github!) - Luis- - 29.04.2015

I'm currently using it on OnGameModeExit. Guessing I shouldn't be?


Re: [REL] MySQL Plugin (Now on github!) - RaeF - 01.05.2015

is there any difference speed between orm and cache?, and is it possible to use packed string?


Re: [REL] MySQL Plugin (Now on github!) - Evocator - 06.06.2015

I lost connection to my mysql database - but sadly the code did not do its job. I think this is the bug that you tried to fix in R39-3? or am i doing it wrong?

Код:
public OnQueryError(errorid, error[], callback[], query[], connectionHandle)
{
	switch (errorid)
	{
		case CR_SERVER_GONE_ERROR:
		{
			printf(">>>>>>>>>>>>>>>>>>>> Lost connection to MYSQL, trying reconnect...");
			mysql_reconnect(connectionHandle);

			if (mysql_errno() != 0)
   			{
   				printf("Locking, no connection to database");
				// lock the server with a pass
			}
			else
			{
				printf("unlocked, we are connected again!");
				// unlock it
			}
		}
		default:
		{
			printf("[ERROR MYSQL]: errorid(%i) error(%s), callback(%s), query(%s), Handle(%i)", errorid, error, callback, query, connectionHandle);
		}
	}
	return 1;
}
LOG:
Код:
[14:08:37] [ERROR MYSQL]: errorid(2003) error(Can't connect to MySQL server on 'x.x.x.x' (111)), callback(), query(-), Handle(1)
[14:08:37] [ERROR MYSQL]: errorid(2003) error(Can't connect to MySQL server on 'x.x.x.x' (111)), callback(), query(-), Handle(1)
[14:08:37] [ERROR MYSQL]: errorid(2003) error(Can't connect to MySQL server on 'x.x.x.x' (111)), callback(), query(-), Handle(1)
[14:08:38] [ERROR MYSQL]: errorid(2003) error(Can't connect to MySQL server on 'x.x.x.x' (111)), callback(), query(-), Handle(1)
[14:08:38] [ERROR MYSQL]: errorid(2003) error(Can't connect to MySQL server on 'x.x.x.x' (111)), callback(), query(-), Handle(1)
[14:08:38] [part] jakulut has left the server (20:0)
[14:08:39] [ERROR MYSQL]: errorid(2003) error(Can't connect to MySQL server on 'x.x.x.x' (111)), callback(), query(-), Handle(1)
Mysql File:
Код:
[14:08:37] [ERROR] CMySQLQuery::Execute[] - (error #2003) Can't connect to MySQL server on 'x.x.x.x' (111)
[14:08:37] [ERROR] CMySQLQuery::Execute[] - (error #2003) Can't connect to MySQL server on 'x.x.x.x' (111)
[14:08:38] [ERROR] CMySQLQuery::Execute[] - (error #2003) Can't connect to MySQL server on 'x.x.x.x' (111)
[14:08:38] [ERROR] CMySQLQuery::Execute[] - (error #2003) Can't connect to MySQL server on 'x.x.x.x' (111)
[14:08:39] [ERROR] CMySQLQuery::Execute[] - (error #2003) Can't connect to MySQL server on 'x.x.x.x' (111)
[18:23:53] [ERROR] CMySQLQuery::Execute[] - (error #1317) Query execution was interrupted
[18:23:53] [ERROR] CMySQLQuery::Execute[] - (error #2003) Can't connect to MySQL server on 'x.x.x.x' (111)
[18:23:53] [ERROR] CMySQLQuery::Execute[] - (error #2003) Can't connect to MySQL server on 'x.x.x.x' (111)
[18:23:55] [ERROR] CMySQLQuery::Execute[] - (error #2003) Can't connect to MySQL server on 'x.x.x.x' (111)
[18:23:56] [ERROR] CMySQLQuery::Execute[] - (error #2003) Can't connect to MySQL server on 'x.x.x.x' (111)



Re: [REL] MySQL Plugin (Now on github!) - maddinat0r - 06.06.2015

You don't need that check - the MySQL plugin does it already (if you have auto-reconnect set to 'true' in 'mysql_connect').
Also the "CR_SERVER_GONE_ERROR" error has the error id '2006', thus it does not reconnect because "OnQueryError" reports the error id '2003'. Basically your code is doing its job: printing the error id and message if it's not the 'CR_SERVER_GONE_ERROR' error.


Re: [REL] MySQL Plugin (Now on github!) - Evocator - 06.06.2015

Yes i am aware of that, but my question here is, how can i get to know when the connection is down and then when it is back up.

I need this so i could lock down the server when the connection is out so that people who should be blocked, not to join.


Re: [REL] MySQL Plugin (Now on github!) - MarcGonzales - 13.06.2015

i dont really understand that ORM thing, I learnt SQL pretty well. Can anyone give me a_mysql where queries can be done?