1/25/2011 - v2.1.1
Fixed bug that caused the server to crash when mysql_close was called with multiple connections.
Fixed bug with mysql_query_array that caused strings to randomly override each other.
Fixed bug that caused the server to crash when a null string was passed through a parameter.
Changed a few error strings.

11/24/2010 - v2.1:
Thanks to Blacklite properly debugging the plugin, all reported crashes have been fixed.
The following functions which were unstable have been fixed: mysql_fetch_field, mysql_fetch_field_num, mysql_fetch_int, mysql_fetch_float and mysql_fetch_string.
I have also found a proper way to fix libmysqlclient_r.so.X missing errors. See below.
Fixed mysql_query's return value; returns 0 on successful query, returns error id on failed query,

8/7/2010 - v2.0:
Biggest update since initial release.
Entire plugin has been re-designed using classes, and all functions have been re-coded.
Full linux multi-threaded compatibility, compiled with thread-safe mysql build. Tested on linux (debian 5) server, sever executed a total of 3,542 queries and was online for about a half hour, no crashes. I will also be testing it further for longer periods of time.
Added mysql_init: initializes mysql connection and returns connection handle, (instead of initializing mysql inside mysql_connect).
Removed mysql_reload function and added mysql_refresh, added mysql_reload define macro.
Added mysql_get_character_set: gets the current character set in use.
Added wiki page to the SA:MP Wiki.

3/26/2010 - v1.2.1:
Fixed various bugs that caused the server to crash with various functions.
Added more error checking to prevent crashes even if pawn coded badly.
Cleaned up the code more.
Optimized the code a lot.
Changed some small things with the thread (for testing).
Added list functionality for the AMX variable, it should work fully with filterscripts now. (Thanks to Incognito for the technique)

2/7/2010 - v1.2:
Added new parameter to mysql_query to push a spare id of any kind to the threaded callback. (suggested by Wicko)
Added mysql_query_array, which is the same as mysql_query, but lets you push an array of integers, floats, booleans, etc, or a string to OnMysqlQueryArray.
Added callback OnMysqlQueryArray which works with mysql_query_array.
Fixed some more small coding errors.Here is another small example by Wicko on how the new callback and function is used.

2/3/2010 - v1.1.2:
Fixed small bug with mysql_fetch_field.
Added mysql_fetch_row_data to work in conjunction with mysql_fetch_field. Here is an example on how to use this function.
Added mysql_fetch_string.

2/2/2010 - v1.1.1:
Added ProcessTick functionality to the plugin to prevent random crashes when calling OnMysqlQuery from query thread.
Updated mysql_query to prevent allocated memory from not being free'd on error. (Thanks to Wicko)
Changed max connections to 4. If you need to be connected to more than 4 databases at a time you can change MAX_CONNECTIONS in the source and compile.

1/31/2010 - v1.1:
Added multi-connection support! You can connect up to a max of 20 databases at a time!
Added threaded query callback! You've all been asking for it! And here it is!
Added error handling callback! You can now have full control of error handling!
Added mysql_result_stored function to check if a result was successfully stored after mysql_store_result.
Added 1 more param to mysql_log to toggle errors printed to the server window. And changed the first param to take log types (info below).
Fixed many small script errors and optimized most of the functions!

1/26/10 - v1.0.2:
Fixed a couple more small problems.
Added functions: mysql_fetch_field_num, mysql_fetch_int, and mysql_fetch_float.
Cleaned up the code a bit.

1/24/10 - v1.0.1:
Fixed small memory leak and bug that crashed the server if mysql_fetch_row was called with a result ~256 cells big and when mysql_log was on.

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:

Windows:

Download the plugin.

Place the mysql.dll in your plugins folder, and move libmysql.dll to the same directory the server exe is.

Open your server.cfg and add "mysql" to "plugins", if there is no "plugins" line, add one.

Add mysql.inc to your /pawno/includes/ and add "#include <mysql>" to the top of your script.

Linux:

Download the plugin to your linux server.

Place the mysql.so in your plugins folder.

Open your server.cfg and add "mysql.so" to "plugins", if there is no "plugins" line, add one.

On the PC that you compile your script on, add mysql.inc to your /pawno/includes/ and add "#include <mysql>" to the top of your script.

You use this callback if you want to have your query executed in a separate thread. Avoiding any lagging of the server itself, it basically separates the query from the server so if it takes the query 5 seconds to run, the server wont lag at all. You can now use spareid to pass a playerid or any other id.

Example below on use.

forward OnMysqlQueryArray(resultid, extravars[], MySQL:handle)

You use this callback for the same reason as OnMysqlQuery, but if you want to pass more than 1 extra variable, and/or if you want to pass something other then an integer. Because it uses the {Float,_}: tag, you can pass any tag, you can also pass a string to the callback.

Example below on use.

forward OnMysqlError(error[], errorid, MySQL:handle)

You use this callback to have 100% control on handling errors from mysql queries and functions. With the raw data being passed through you can do anything you want with it. You can also print the errors from your script and disable errors being printed from the plugin with mysql_log params (explained below). Also, for the advanced users, HERE is a list of error codes.

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?

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.