AckMySQL

Posted By: Razoron

AckMySQL - 07/17/10 13:49

Currently, I'm working with the MySQL functions to boost my serverlist and created a plugin, because I couldn't find a working plugin for A7.
Download: http://razgames.de/wp-content/uploads/Ackmysql.zip
A commented test script is included.

New version:
New features:
- Threaded queries
- Help file

Threaded queries is not that tested, but it should work.
Any other features needed?

Download: http://razgames.de/wp-content/uploads/Ackmysql-1.1.zip

Cu
Posted By: MasterQ32

Re: AckMySQL - 07/17/10 14:37

cool!
i like thes dll!
Posted By: SchokoKeks

Re: AckMySQL - 07/17/10 15:24

I'm currently using the original A6mysql by Destop, it works perfectly with A7, but doesn't support dynamic string resizing for the results it gets from the database.

Could you add threads to the plugin, so that the whole game doesn't have to pause when you do a large request? that is a must for a professional game server, and something that I'm really missing with A6mysql.
Posted By: Razoron

Re: AckMySQL - 07/17/10 15:28

I tryed it, i didn't work for me. However, that is not that easy, but possible.
Posted By: XuserTM

Re: AckMySQL - 07/17/10 15:35

a lot of thanks.I was looking for one week.I very very happy grin
Posted By: XuserTM

Re: AckMySQL - 07/17/10 16:20

okey .
I want ask a question?
How I can get row number?

var abc = ackmysql_query_result("SELECT * FROM hesaplar WHERE Hesap='ccc'",1);
wait(1);
row_num = ackmysql_num_rows(abc);
ackmysql_fetch_row(1, 0, abcsd);

Bud always , row_num = 1 ; :S
Posted By: Razoron

Re: AckMySQL - 07/17/10 16:32

ackmysql_query_result returns a BOOL.
1 = TRUE = ACKMYSQL_SUCCESS
0 = FALSE = ACKMYSQL_FAILURE
You need to use the result you stored before with ackmysql_query_result as parameter.
row_num = ackmysql_num_rows(1);
You stored the result in an array with as index of 1.
Posted By: XuserTM

Re: AckMySQL - 07/17/10 17:02

What time the update?
Posted By: Razoron

Re: AckMySQL - 07/17/10 18:39

Originally Posted By: XuserTM
What time the update?

Now!
New features:
- Threaded queries
- Help file

Threaded queries is not that tested, but it should work.
Any other features needed?

Download: http://razgames.de/wp-content/uploads/Ackmysql-1.1.zip
Posted By: XuserTM

Re: AckMySQL - 07/17/10 18:51

thanks laugh I try
Posted By: Kral

Re: AckMySQL - 07/17/10 18:52

thank you (:
Posted By: XuserTM

Re: AckMySQL - 07/17/10 19:07

unsigned long ackmysql_num_rows(int savekey);
Shows how many rows the result, given in savekey, has

Returns:
*
The number of rows.
__________
This is not Return the number of rows???
Posted By: Razoron

Re: AckMySQL - 07/17/10 19:09

It returns the number of rows... I tested it at my serverlist.
Posted By: XuserTM

Re: AckMySQL - 07/17/10 19:40

My mysql table
||||||id ||User |||| pass
1 aaa bbb
2 dddd bzzbb



I could not do ,
ackmysql_query_result_threaded("SELECT * FROM users WHERE User ='dddd'",1);
wait(5);
num_rows = ackmysql_num_rows(1);
ackmysql_fetch_row(1, 1, result);


result = 2 . it is id.
Bud I want result pass.
I try
ackmysql_fetch_row(1, 2, result);
bud did not.
Posted By: Razoron

Re: AckMySQL - 07/17/10 20:03

You don't need to use mysql_num_rows.

Code:
ackmysql_query_result_threaded("SELECT pass FROM users WHERE User='dddd'", 1);

while(ackmysql_query_state() == ACKMYSQL_RUNNING) {wait(1);}

ackmysql_fetch_row(1, 0, result);


Posted By: XuserTM

Re: AckMySQL - 07/17/10 20:08

Thanks a lot,I succeed.
Posted By: invictus

Re: AckMySQL - 07/31/10 19:39

hi... im having a problem connecting 3dgs to ackmysql... it always says empty prototype in main when i run the test... i alread placed the necessary files (dlls and headers) to their respective folder but im still having problems.. im using only a free version of 3dgs..
Posted By: XuserTM

Re: AckMySQL - 08/01/10 14:35

function main()
{
ackmysql_init();
wait(1);
... your code...
}

=)
Posted By: Razoron

Re: AckMySQL - 08/02/10 11:37

No, ackmysql would crash if you don't initialize it. You won't get an empty prototype error.
Did you copy also libmysql.dll to your projects plugin dir?
Show me your acklog.
Did you install VC++ 2010 redistributable (32 bit)?
Posted By: Darkmax

Re: AckMySQL - 08/03/10 13:38

im having the same problem that invictus.

i copy the ackmysql.dll and libmysql.dll to c:\Program Files\GStudio7 (i think is there where i have to paste those files)

then i paste the ackmysql.h to my project folder and tried the test.c that you include in the zip file.

I change the information of the database with mine, but when i run the program, says an error "Empty prototype called in main" and also "Couldn't connect to mysql server".

If some one knows why im having this errors?, i would be very pleased because im trying to use gamestudio for a project and using a database is a must.
Posted By: Darkmax

Re: AckMySQL - 08/03/10 23:46

i resolve my problem, something weird in my computer because i try in another and works, but i dont understand how i can receive various columns, for example this query

SELECT name,lastname,address,telephone FROM users WHERE id = 3

and save the result in array. To use it, in my application.
Posted By: Razoron

Re: AckMySQL - 08/04/10 07:42

You need to copy libmysql.dll and ackmysql.dll in the plugindir of your project.
If you didn't set any plugindir, the plugindir is your work dir.
Posted By: Carlos3DGS

Re: AckMySQL - 08/09/10 09:36

Originally Posted By: Darkmax
i dont understand how i can receive various columns, for example this query

SELECT name,lastname,address,telephone FROM users WHERE id = 3

and save the result in array. To use it, in my application.

I am also curious about this... Is it possible with your plugin to recieve various columns at once? Or do we have the fetch them one by one and store them ourselves?

Originally Posted By: Razoron
Any other features needed?

If we can only select one column at a time then I have a new feature suggestion wink
Selecting multiple columns at the same time. Mabe you can re-use the array you store the results in converting the array into a 3 dimensional array?
Posted By: Darkmax

Re: AckMySQL - 08/27/10 04:57

I'm with Carlos3DGS.

i think that this feature will be nice when you have a lot of queries to do, because now i need to make multiple queries just to have the columns of a table that i need instead of just do it with one query and receive all the columns at once.
Posted By: William

Re: AckMySQL - 10/28/10 02:07

Cool, thanks for building this. Although the links do not work?
Posted By: Razoron

Re: AckMySQL - 10/31/10 17:23

Reuploaded.
Posted By: Razoron

Re: AckMySQL - 11/21/10 14:14

I accidently renamed the file. Link is up again.
© 2024 lite-C Forums