SA-MP Forums Archive
[Plugin] [REL] SA:MP MySQL Plugin 2.1.1 - Released (1/25/2011 - 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] SA:MP MySQL Plugin 2.1.1 - Released (1/25/2011 (/showthread.php?tid=122983)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22


[REL] SA:MP MySQL Plugin 2.1.1 - Released (1/25/2011 - StrickenKid - 24.01.2010

SA:MP MySQL Plugin
Version: 2.1.1

Now Linux Stable!

Latest Release: 2.1.1 Build-165

ChangeLog:
About:

This is a MySQL Plugin that enables you to connect to any MySQL database to make any query, and retrieve the results. This is pretty much the fastest and most stable MySQL plugin in SA:MP. This plugin is setup so it will send you an error message on what you've done wrong instead of just crashing, making it very stable. For example, if you execute a SELECT query and forget to store the result and try to retrieve it with mysql_fetch_row, the mysql_fetch_row function will send: "MySQL Error: 'mysql_fetch_row' called when no result stored." to the console window. This plugin is also equipped with a whopping 28 native functions, all useful for your SA:MP server.

How To Install:
Functions:
Wiki Page (Detailed Function List):

Can be found here.

Feel free to contribute to the wiki page.

Callbacks:
See the wiki page for callback examples.

Downloads (2.1.1 - Build 165):


IMPORTANT: If you cannot compile your own mysql build (on a hosted server e.g. ServerFFS), use the static build.
Running on Linux?

Having problems with libmysqlclient_r.so.X?

If you cannot do this, use the static build.
  1. First of all, you must locate where your mysql libraries are located.
    Mine are located at: /usr/local/mysql/lib/mysql
  2. Now, open libc.conf located in /etc/ld.so.conf.d
  3. Add the mysql libraries' path to the end of this file, on a new line.
  4. Save the file, and execute: ldconfig
Want To Compile It Yourself?
Thanks To:
Post Comments And Questions!
[/list][/list]


Re: [REL] SA:MP MySQL Plugin 1.0 - Blacklite - 24.01.2010

Good to see it finally here. Nice job, StrickenKid!


[REL] SA:MP MySQL Plugin 1.0 - [NoV]LaZ - 24.01.2010

Looks very interesting, but you forgot to add the source code.
________
Infant Zoloft


Re: [REL] SA:MP MySQL Plugin 1.0 - StrickenKid - 24.01.2010

Quote:
Originally Posted by [NoVt
LaZ ]
Looks very interesting, but you forgot to add the source code.
Sorry, fixed, and I didn't forget, I just got the links mixed up.


Re: [REL] SA:MP MySQL Plugin 1.0 - MX_Master - 24.01.2010

Great! it's exactly what I need (:


Re: [REL] SA:MP MySQL Plugin 1.0 - Toney - 24.01.2010

Hm nice done i think it will most stable and full mysql version for SA-MP client. Thanks.


Re: [REL] SA:MP MySQL Plugin 1.0 - potato - 24.01.2010

Nice work!
But can you give in few words why should I (or someone else for that matter) use this plugin instead of those other plugins?
I do see some extra functions, that I actually needed before, but is this all?


Re: [REL] SA:MP MySQL Plugin 1.0 - Jay_ - 24.01.2010

Nice work. Just a question though, what makes this plugin better than this one? It may have some extra natives, but it lacks something performance wise which makes G-sTyLeZzZ's version outrank yours: a threaded callback.


Re: [REL] SA:MP MySQL Plugin 1.0 - MenaceX^ - 24.01.2010

Wow, I've been waiting so long for a new plugin.

I'll talk to you in MSN


Re: [REL] SA:MP MySQL Plugin 1.0 - Dreftas - 24.01.2010

Cool. I will try this plugin instead of G-Stylezz Really good work.


Re: [REL] SA:MP MySQL Plugin 1.0 - Eazy_Efolife - 24.01.2010

Good work.


Re: [REL] SA:MP MySQL Plugin 1.0 - Dreftas - 24.01.2010

Damn.. crashed


Re: [REL] SA:MP MySQL Plugin 1.0 - Misiek - 24.01.2010

I'd use it as soon as possible if it had multithreading capabilities like G-Stylezz's one does.
Otherwise another MySQL plugin is usable only for a tiny group of people here and I advise you to go this way.

Regards.


Re: [REL] SA:MP MySQL Plugin 1.0 - Toney - 24.01.2010

Dreft maybe do you want post more info about crashed.. I test it , works fine.


Re: [REL] SA:MP MySQL Plugin 1.0 - Dreftas - 24.01.2010

It crashes on a long row which is taken with mysql_fetch_field. Row is ~1050 symbols lenght.


Re: [REL] SA:MP MySQL Plugin 1.0 - StrickenKid - 24.01.2010

Quote:
Originally Posted by Dreft
It crashes on a long row which is taken with mysql_fetch_field. Row is ~1050 symbols lenght.
I will check that right now. Thanks.

EDIT:

Ok, I've tested it with 3000 characters and the plugin worked fine, I then tried to print the row and that is what crashed it. So make sure you're not printing a row with ~1500 characters in it.
Also, make sure your buffer string that your saving the row to is ~1500 characters because that would cause a crash.

Quote:
Originally Posted by Jay_
Nice work. Just a question though, what makes this plugin better than this one? It may have some extra natives, but it lacks something performance wise which makes G-sTyLeZzZ's version outrank yours: a threaded callback.
The reason for me creating this plugin is to let SA:MP have the most stable plugin, because the other 2 MySQL plugins that are released indeed have bugs and those bugs haven't been fixed yet. And these bugs were found many months ago....

So no, my plugin doesn't have a threaded callback, but, I wouldn't want to add that because that's unique to G-Stylezzz plugin, and in my opinion that would just cause trouble to be copying features from others.

This was also created for speed, as far as I know, its faster than adrenaline-dj's plugin (haven't tested g-stylezzz plugin yet) but i did some testing on my plugin and it takes arround 1.0 to 1.3 seconds to execute 5,000,000 (5 million) mysql_fetch_row's. I tested the same on adrenaline-dj's plugin, and it crashed.


Re: [REL] SA:MP MySQL Plugin 1.0 - MenaceX^ - 24.01.2010

I wonder if you'll make a debug mode.
If yes talk to me, I have several suggestions.


Re: [REL] SA:MP MySQL Plugin 1.0 - StrickenKid - 24.01.2010

Quote:
Originally Posted by MenaceX^
I wonder if you'll make a debug mode.
If yes talk to me, I have several suggestions.
mysql_log(1); will turn on logging (debugging) The plugin also automatically prints errors you make to the server window.

For example:

Code:
mysql_query("select * from `accounts` where user_id = 5");
new buffer[1024];
mysql_fetch_row(buffer);
mysql_free_result();
In the code above, I never did mysql_store_result, so, you will get the folloing error in the server window:
"MySQL error: 'mysql_fetch_row' called when no result stored."

But yeah, well talk on MSN later.


Re: [REL] SA:MP MySQL Plugin 1.0 - Dreftas - 24.01.2010

Ok, i turned off mysql_log() which was printing that all row and crash gone I wish that you fix this problem :P

Thanks for plugin again, it will change old G-Stylezz plugin for sure


Re: [REL] SA:MP MySQL Plugin 1.0 - Blantas - 24.01.2010

Looks good. I'll check it out tomorow.