SA-MP Forums Archive
[Plugin] MySQL & PostgreSQL Plugin - 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] MySQL & PostgreSQL Plugin (/showthread.php?tid=429464)

Pages: 1 2 3 4 5 6 7 8 9


Re: MySQL Plugin - Dan.. - 12.04.2013

Quote:
Originally Posted by dnee
Посмотреть сообщение
You forgot

Add in mysql.inc
Код:
#define LOG_DEBUG                        1
#define LOG_INFO                        2
#define LOG_WARNING                        3
#define LOG_ERROR                        4

native MySQL:mysql_debug(debug_level);
I've changed to LOG level 3 [LOG_WARNING]
Код:
OnGameModeInit()
{
mysql_debug(LOG_WARNING);
}
Oh yes, I forgot completely.


Re: MySQL Plugin - dnee - 12.04.2013

My server had 100-150k Line of Coding, 20-200 Peak users.

Dan.. Plug-ins seem used more cpu than BlugG (R6)
I think may be plugin had memory or cpu leak?

PS. No crash detected, No warning. Good work keep up!




Re: MySQL Plugin - BrandyPenguin - 12.04.2013

Is there a way to turn logging completely off?


Re: MySQL Plugin - dnee - 12.04.2013

Quote:
Originally Posted by BrandyPenguin
Посмотреть сообщение
Is there a way to turn logging completely off?
mysql_debug(5);


Re: MySQL Plugin - BrandyPenguin - 12.04.2013

Quote:
Originally Posted by dnee
Посмотреть сообщение
mysql_debug(5);
To me it's logical if it would be 0 - but it's not in include?


Re: MySQL Plugin - Dan.. - 12.04.2013

Quote:
Originally Posted by dnee
Посмотреть сообщение
My server had 100-150k Line of Coding, 20-200 Peak users.

Dan.. Plug-ins seem used more cpu than BlugG (R6)
I think may be plugin had memory or cpu leak?

PS. No crash detected, No warning. Good work keep up!

I'll try fixing that. Can you post logs and fragments of code? Are you using threaded or non-threaded queries? Are you freeing the result?

Quote:
Originally Posted by Bicentric
Посмотреть сообщение
This is interesting, what would be really cool if you decided to release a PostgreSQL plugin in the future! There already has been demand for one which you may have seen already:

https://sampforum.blast.hk/showthread.php?tid=413650
I'm planning on adding PostgreSQL as soon as MySQL is stable.


Re: MySQL Plugin - Dzines4SAMP - 20.04.2013

Quote:
Originally Posted by Dan..
View Post
No new natives were added.
Then at-least change the documentation title to v0.6


Re: MySQL Plugin - Dan.. - 23.04.2013

Quote:
Originally Posted by Dzines4SAMP
View Post
Then at-least change the documentation title to v0.6
I updated it.

--

Plugin updated to v1.0!


Re: MySQL Plugin - Gigi-The-Beast - 23.04.2013

You have an error in the documentation:

Code:
mysql_escape_string

Pings the MySQL server.

Syntax

mysql_escape_string(handle, src[], dest[], dest_len)

handle	<MySQL > The MySQL handle used for escaping the string.
src	< [] > The source of the unescaped string.
dest	< [] > The destination where the escaped string will be stored.
dest_len	 The capacity of the destination.

Returns

The length of the escaped string.

Remarks

Estimated stack usage

1 cells



Re: MySQL Plugin - Dan.. - 23.04.2013

Quote:
Originally Posted by Gigi-The-Beast
View Post
You have an error in the documentation:

Code:
mysql_escape_string

Pings the MySQL server.

Syntax

mysql_escape_string(handle, src[], dest[], dest_len)

handle	<MySQL > The MySQL handle used for escaping the string.
src	< [] > The source of the unescaped string.
dest	< [] > The destination where the escaped string will be stored.
dest_len	 The capacity of the destination.

Returns

The length of the escaped string.

Remarks

Estimated stack usage

1 cells
Thank you!


Re: MySQL Plugin - Richard_Gere - 24.04.2013

Update download links please.


Re: MySQL Plugin - Dan.. - 25.04.2013

Quote:
Originally Posted by Richard_Gere
View Post
Update download links please.
Oh sorry, will do!


Re: MySQL Plugin - Yiin - 07.05.2013

best mysql plugin ever.


Re: MySQL Plugin - Dan.. - 07.05.2013

Quote:
Originally Posted by Yiin
View Post
best mysql plugin ever.
Next update will make this best SQL plugin ever (it will support both, MySQL and PostgreSQL). I can't say any ETA, but I hope it will be soon.


Re: MySQL Plugin - Richard_Gere - 07.05.2013

Quote:
Originally Posted by Dan..
View Post
Next update will make this best SQL plugin ever (it will support both, MySQL and PostgreSQL). I can't say any ETA, but I hope it will be soon.
PostgreSQL, finally! As I was waiting for this for a long time)


Re: MySQL Plugin - Ricop522 - 07.05.2013

Nice work Dan.
I'll try it.

Can you make more error messages, you know, like our friend said, ex.: "the db %s doesnt exist", etc.

This plugin is awesome, please, keep working and dont give up. =)


Re: MySQL Plugin - Ryan_Obeles - 08.05.2013

Dan can u please update ur outdated example pwn thx


Re: MySQL Plugin - Dan.. - 10.05.2013

Quote:
Originally Posted by ******
Посмотреть сообщение
Are you aware that the binaries in the first post don't match the include?

Edit: If anyone wants an updated example script using the newest plugin version (the one with "sql" not "mysql" function names, that currently you have to compile yourself):

https://github.com/Y-Less/YSI-Includ...sers/Dan10.inc

Edit 2: I keep getting a syntax error when I run this query through the plugin:

Код:
SELECT @Y:=MAX(yid) FROM y_users_preload;INSERT INTO y_users_preload VALUES(DEFAULT, @Y + 1, 'Alex', '9BD7575A156544838F2BD3A3DC2FAAADED4D88250B65EF82D6CFC5BE9179BBD8EF13000685376268DF705F6FC2F4FFC5254AF8D1ED3FD99B49B89FB9AF651D91', 'EN', 0, 1368148884);SELECT (@Y + 1);
However, it runs perfectly when done in phpMyAdmin (same SQL user). For reference, I'm copying that straight out of the debug logs in my server where it says what query is being run, and pasting it straight in to my control panel. Any clue why this is?
I've kept updating the plugin and the include is up-to-date relative to latest binary from master branch. Use the .inc file provided with .so or .dll file.

That query is not working fine because there are multiple queries and just the first one is executed. I will enable execution of multipe queries in the next version (I hope).

I suggest you make the `yid` primary key and use auto-increment attribute. http://dev.mysql.com/doc/refman/5.0/...increment.html

You can recieve the insert ID using mysql_insert_id.


Re: MySQL Plugin - Ryan_Obeles - 10.05.2013

hmmmmmmmm ****** i just wanted dan to use his new functions together with his updates so it would be easier to understand


Re: MySQL Plugin - Dan.. - 10.05.2013

Quote:
Originally Posted by ******
Посмотреть сообщение
Ok, I've written a few multi-query strings I'll have to check. Unfortunately I can't make yid unique as multiple names can be associated with the same account.
I've already added multiple result sets in v2.0. However, I won't release 2.0 until I finish PostgreSQL support.